GithubHelp home page GithubHelp logo

Comments (7)

pmwmedia avatar pmwmedia commented on May 25, 2024
  1. All my error logs and the info, some debug logs are jumbled into a single file. How can I separate these, such that they come into a single file say "errors.log" and info strings come into another file say "messages.log"?

Currently that it is only partly possible. You can write all error log entries in a log file and all info log entries and higher to another one. But you cannot write info log entries without also writing warning and error log entries to a log file.

tinylog.writer1 = file
tinylog.writer1.filename = errors.log
tinylog.writer1.level = error
tinylog.writer2 = file
tinylog.writer2.filename = messages.log
tinylog.writer2.level = info

Maybe you are looking for tinylog 2.0. It is still under development, but tag support is already implemented. With tags you can excatly do, what you want. (see: #6)

  1. I want the timestamp to be in microseconds that mean like, data: Time in "HH:mm:ss:milli-seconds:Micro-seconds". Is there any way to do?

Yes, that is possible for timestamp labeler and in the format pattern. You just have to use three upper case S:

tinylog.writer.label = timestamp: yyyy-MM-dd HH-mm-ss-SSS
tinylog.format = {date:yyyy-MM-dd HH:mm:ss:SSS} {class}.{method}()\n{level}: {message}

from tinylog.

Hema-Chandra avatar Hema-Chandra commented on May 25, 2024

@pmwmedia Thanks for the fast reply. Using three upper case S: logs entries in milli-seconds right? I wanted the time stamp in Micro-seconds. Is it possible to do so?

I didn't understand clearly what "But you cannot write info log entries without also writing warning nd error log entries to a log file." this means. Can you please elaborate more.

from tinylog.

pmwmedia avatar pmwmedia commented on May 25, 2024

Using three upper case S: logs entries in milli-seconds right? I wanted the time stamp in Micro-seconds. Is it possible to do so?

Sorry, I mixed milliseconds and microseconds. Microseconds are currently not supported. If you like, you can describe the use case and create a feature request for tinylog 2.

I didn't understand clearly what "But you cannot write info log entries without also writing warning nd error log entries to a log file." this means. Can you please elaborate more.

You can define multiple writers and define for each another severity level. For example, a writer with the severity level INFO will output all log entries with the severity level INFO, WARNING and ERROR. A writer withe severity level ERROR will output only log entries with the severity level ERROR. If you have a file writer with the severity level INFO and a second file writer with the severity level ERROR, you will have a log file that contains all log entries with severity level INFO and above as well as a second log file that contains only log entries with severity level ERROR. Of course this works for all writers incldung the rolling file writer.

from tinylog.

Hema-Chandra avatar Hema-Chandra commented on May 25, 2024

Thank you sir. I wanted to make the micro-seconds logging as a feature. We work on stock-exchange market. As a result we will be having continuous changing of data every micro-seconds, so we need to log the data at that particular micros. Is there any way to do so? Or else you can suggest any other library that can log in Micro-seconds. But , I love tinylog. It's parallel thread logging helped me a lot.

from tinylog.

pmwmedia avatar pmwmedia commented on May 25, 2024

I don't know any other logging framework which is supporting microseconds logging. Currently I'm experimenting with implementing support for microseconds and nanoseconds. The solution has to be fast (good performance) and intuitive.

from tinylog.

pmwmedia avatar pmwmedia commented on May 25, 2024

I have just released the first release candidate of tinylog 1.3. Microseconds (SSSSSS) and nanoseconds (n, N) are supported now on Java 9. Both work only with Java 9 as previous versions of Java don't provide any API to receive the current date with micro- or nanoseconds.

@Hema-Chandra Feedback is welcome :)

from tinylog.

github-actions avatar github-actions commented on May 25, 2024

This closed issue has been locked automatically. However, please feel free to file a new issue.

from tinylog.

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.