Giter Site home page Giter Site logo

Comments (4)

alessandro-bottamedi avatar alessandro-bottamedi commented on May 17, 2024 1

Fixed in v 5.0.0, you che use date-today as fileName to create a new file every day.

from react-native-logs.

alessandro-bottamedi avatar alessandro-bottamedi commented on May 17, 2024

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.

pke avatar pke commented on May 17, 2024

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.

pke avatar pke commented on May 17, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.