Comments (7)
- 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)
- 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.
@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.
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.
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.
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.
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.
This closed issue has been locked automatically. However, please feel free to file a new issue.
from tinylog.
Related Issues (20)
- Log to separate log files using tinyLog HOT 3
- Tinylog.org only has Javadoc for tinylog-api HOT 1
- Ability to apply specific writer HOT 1
- Structured logging HOT 2
- Ability to use SLF4J Logger's name as tag HOT 2
- Class name stripping after dollar sign $ HOT 1
- Add overloaded "isEnabled" method that takes loggerClassName instead of callerDepth HOT 1
- org.slf4j.LoggerFactory.getLogger fails with java.lang.NoClassDefFoundError: org/slf4j/spi/LoggingEventAware after upgrading to 2.6.0 HOT 3
- more verbose than necessary HOT 3
- Multiple Log Files created when rollover is initiated HOT 1
- Trying to use thread placeholder on Rolling File writer HOT 3
- tinylog not logging some messages when used via SLF4J 2.0 fluent API HOT 1
- Why Can't I find this package anywhere org.tinylog.rules HOT 1
- No clear way how to integrate with FastCSV HOT 1
- JSON Logging to the Console HOT 3
- Is there a way to tell if the logger is still active? HOT 2
- Circumvent "Error initializing logging: java.lang.UnsupportedOperationException" when using 3rd-party SDK that also uses tinylog for logging HOT 5
- Format time in UTC timezone HOT 1
- tinylog.properties does not seem to be read in version 2.6.2, but works in 2.5.0. HOT 3
- Logger class is missing stack trace error HOT 3
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 tinylog.