Comments (4)
Fixed in v 5.0.0, you che use date-today
as fileName to create a new file every day.
from react-native-logs.
it is indeed as you wrote, if a user opens the app at 23:59 it will continue to use that file until it is restarted.
As you guessed, I didn't want to change the filename every time a log is made to avoid performance issues (although the fileTransport is already heavy so it might not affect performance too much).
Another alternative would be to add a method to dynamically change the transport options so that the user can change the file name when necessary, what do you think?
from react-native-logs.
On the desktop java frameworks usually optimise that using cron like syntax and tooling to roll over and package the old log files. It almost costs no perf of course (mostly I/O which runs in a second thread).
I thought about setting a timeout until midnight from current time but RN Android does not support long running timers (and will display a yellow box warning if a timeout is set longer than 30(?) mins.)
So how about a RollingFileAppender that checks the current dates day (date is fetched anyway to log it) and if it differs from the previous day it creates a new file and saves the new log entry and all following into the new file.
It could optionally gzip the previous day files.
I think we can pretty much learn from decades of high performance Java logging frameworks like log4j or even better slf4j.
from react-native-logs.
Is this fixed with the newest release? Is the filename function called on every log now as the readme example suggest?
If so you could close this issue ;)
from react-native-logs.
Related Issues (20)
- Bug: function type log arguments are printed as `null` HOT 3
- Disable not working HOT 2
- Type errors with noUncheckedIndexedAccess HOT 2
- extensionColors not working on zsh macOS terminal HOT 1
- In transportOptions I'm Not able generate logs.txt file HOT 7
- I'm not able to generate and save(see) log in file manager (storage) of mobile device HOT 1
- how we can access log.txt file in iOS device HOT 5
- Queue? HOT 1
- Open to adding custom formatting support? HOT 2
- Sentry transporter seems to log always to error despite using info/debug.. HOT 2
- Is it possible to store file in Zip(compressed log.txt file) with in cache directory HOT 1
- NSMallocException - Expo device build fatal crash with FileAsyncTransport HOT 1
- Is there a way to pass types to transport function props? HOT 1
- today date formatting is incorrectly described in the docs HOT 1
- Logging to a log level with undefined transport causes app to crash HOT 2
- Using react-native-logs in a regular 'react' web app? HOT 2
- Date format with using {date-today}
- use withScope to sentry's message logging?
- Logs cluttered with unformatted component trees
- Logs are not showing color on metro bundler for React native
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-native-logs.