DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Logger Tinylog 0.8 Supports Application Servers

Martin Winandy user avatar by
Martin Winandy
·
Mar. 08, 13 · Interview
Like (1)
Save
Tweet
Share
3.01K Views

Join the DZone community and get the full member experience.

Join For Free
tinylog, an open source logger for Java, has been released in version 0.8. The second to last beta version of tinylog uses class loaders in a different way to supports also application servers such as Glassfish. tinylog is a lightweight alternative to the "de-facto standard Log4j". The aim of the project is to simplify logging in Java. There is only one static logger in tinylog. So the usual and error-prone creation of a logger instance for each class by "Logger.getLogger(MyClass.class)" isn’t necessary anymore.

In tinylog 0.8, the configuration API has been separated from the logging API. Now, the logger can be configured by a fluent interface in the program itself. Of course, it is still possible to configure the logger by environment variables or a properties file. New is that tinylog can observe properties files. This means that changes in the property file will be detected and automically reloaded. Thus, tinylog can be reconfigured at runtime.

Like all loggers, also tinylog uses the stack trace to get runtime information, such as the method or the line in which the log entry has been generated. But due to the special architecture, tinylog knows always the position of the required stack trace element (the depth).  So tinylog can load only the required stack trace element and mustn’t load the full stack trace like other loggers. This is much faster. The loading of the stack trace is usually the "most expensive" operation of a logger and therefore crucial for the performance.

All tests are completely rewritten on the basis of JUnit 4.11 and Hamcrest 1.3. There are now 155 tests, which covers 94 % of the source code of tinylog according to the code coverage tool EclEmma. This shall ensure the stability of tinylog and especially prevent regressions. The new test code is 1.5 times larger than the actual source code of tinylog.

Now, tinylog isn't only as JAR available, but also as Maven artifact and as OSGi bundle. The OSGi bundle can be used as a plug-in in Eclipse RCP applications.

For the last beta version 0.9, the support of multiple logging writers is planned. This will allow for example to write simultaneously log entries to the console and in a log file. But first, Log4j Facade will be released. Log4j Facade is already in the advanced development phase and is a Log4j compatible logging API for tinylog. Log4j Facade simplifies switching from Log4j to tinylog, because it ensures that existing source code and libraries which are using Log4j for logging work with tinylog.

The JAR file of the tinylog 0.8 has a size of only 38 KB. You can download it from www.tinylog.org/download.
application

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • DevSecOps Benefits and Challenges
  • The Real Democratization of AI, and Why It Has to Be Closely Monitored
  • Spring Cloud: How To Deal With Microservice Configuration (Part 1)
  • Agile Scrum and the New Way of Work in 2023

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: