Any good tutorials on lilith (log viewer for Logback)? [closed]
Asked Answered
A

3

13

I am using slf4j + logback for logging. I am looking for a good event log viewer (like Apache Chainsaw). Logback website mentions Lilith. The lilith website is not only ugly (says so on website homepage!) but also lacks any documentation whatsoever.

Are there any tutorials on how to get started with Lilith (may be I am finding it difficult to grasp as I have never used Apache Chainsaw, would it help if I read a tutorial on Chainsaw?).

Also, are there any alternative log viewers for logback with better documentation?

Acerbic answered 25/7, 2012 at 6:27 Comment(0)
O
23

I'm the developer of Lilith and the creator of the ugly homepage. ;)

I know that it is lacking documentation and I'm not very good at "selling" my application.

Please take a look at the readme over at https://github.com/huxi/lilith

I tried to describe the most common use-cases of Lilith in that file. There is also some help contained in Lilith itself.

Ekkehard Gentz has written a small tutorial about Lilith: http://ekkescorner.wordpress.com/2009/09/05/osgi-logging-part-8-viewing-log-events-lilith/

Hope that helps.

Onslaught answered 26/7, 2012 at 0:10 Comment(1)
Thanks @Huxi, that definitely helps! I would say, its worth mentioning these links on the homepage somewhere. As a developer, I am not looking for beautiful homepages, just appropriate documentation to get me started. Also (since this is something I hoped to say to the developer of the app, from the moment I first ran it), you have got to change that logo, whatever be the historical significance!! I was horified by that splash screen (I was at work!), and actually considering dumping the app because of it, till I found out you can disable spash screen. You are definitely alienating some users!Acerbic
L
2

Basically, create a file logback.xml with the following content

<configuration>

   <appender name="LogbackClassic" class="ch.qos.logback.classic.net.SocketAppender">
      <RemoteHost>localhost</RemoteHost>
      <Port>4560</Port>
      <ReconnectionDelay>170</ReconnectionDelay>
      <IncludeCallerData>true</IncludeCallerData>
   </appender>

   <root level="INFO">
      <appender-ref ref="LogbackClassic"/>
   </root>

</configuration>

Make you can pass in this configuration using a system property logback.configurationFile, so you might want to do something like this:

final String LOGBACK = "logback.configurationFile";
if(System.getProperty(LOGBACK) == null)
    System.setProperty(LOGBACK, "file:logback.xml");

That should be enough, once your application start's logging a window will open in Lilith and show you the logs.

Leif answered 12/9, 2012 at 8:45 Comment(0)
S
1

Chainsaw can read any regular text log file, including those created by slf4j and logback.

Try the latest developer snapshot of Chainsaw - it has a ton of new features which make it easy to colorize, search and filter events. You can also annotate any log entry (by adding a comment in the 'marker' field), export the log file from Chainsaw and email the log file to someone else, who can see your log and the comments you added to log entries in-place, exactly as you saw the log when you exported it from Chainsaw.

Chainsaw's initial configuration dialog makes it easy to help you start tailing a log file - you can specify the log file you want to process, and then the format of the file, and Chainsaw will start tailing the file.

If you were using log4j and a fileappender, you could use that log4j.properties file (or log4j.xml) to get Chainsaw to start tailing the log file defined from the fileappender entries in the config file.

Chainsaw also has a tutorial, built in to the UI, available from the help menu or the Welcome tab.

Right click on most anything to see what you can do an explore the menus. Or post a message to the log4j-users mailing list to get questions answered.

The latest developer snapshot of Chainsaw is available here: http://people.apache.org/~sdeboy

Supererogation answered 25/7, 2012 at 6:50 Comment(2)
Do you happen to know when 2.1.0 will be released? I see it has been well over a year and it has not been released. The last official release of chainsaw (I think) does not support opening an existing log file for analysis.Acerbic
The log4j project slowed down a bit but things have picked up significantly lately, and the log4j dependencies Chainsaw relies on are now released or about to be released. I expect an official Chainsaw release to occur soon after. By the way, there is a log4j 2.0 alpha release being made right now with a ton of new features.Supererogation

© 2022 - 2024 — McMap. All rights reserved.