![]() Download Latest Version This application uses: |
August 4th, 2009 ·
906 views / 1838 downloads Category: Tutorials Maturity: Beta API version: 1.4 Tags: not specified |
OVERVIEW
We all some time put print statement in our code for the sole purpose of knowing if another statement is executed or not.
debug purpose i should say. but what happens when the code is a few miles long ?
what about when everything is “OK” and you want to remove all the print statement in the code?
even better, what if you still want some of these print statement to still be displayed in the event of errors .
I know the bug already have Concierge as a logging service but log4j can also be used on top of concierge to
provide logging flexibility to your applications.
The main feature of log4j that I like is the ability to turn off certain logs or all of them if you’d like.
for example, when the product is ready for retail i could just enable logs at the ERROR and FATAL level.
This app is really the same as SimpleGame ( my first application). the only difference is that i have added log4j to the code to show how it can be done. You will also notice that I also cover chainsaw in this example.
chainsaw is used in conjunction with log4j to allow viewing logs from multiples application on multiple remote machines at the same time.
in order to use the chainsaw viewer you will need to download the following
http://logging.apache.org/log4j/docs/webstart/chainsaw/chainsaw-bundle.zip
HOW IT WORKS
run the app and you will see logs i the console window as you play the SimpleGame
another copy of the same log is kept in /home/root/out.log on the physical bug
a copy is also sent to chainsaw for remote viewing in this case to 127.0.0.1 ( localhost)
SETTING UP THE LOG VIEWER
- unzip the file
- locate chainsaw.sh
- make it executable
- run ./chainsaw.sh from the console
MORE ON CHAINSAW
please refer to :
http://community.buglabs.net/switch/posts/146-Chainsaw-HOWTO
to learn more about ChainSaw.
for more reading:
http://logging.apache.org/log4j/1.2/index.html
http://logging.apache.org/chainsaw/index.html
| Download Latest Version |
| Version | Date | Uploaded by | Notes | |
|---|---|---|---|---|
| Version 8 | August 20th, 2009 | switch | ready to go (more) ready to go (collapse) | download |
| Version 7 | August 18th, 2009 | switch | Resolved issue with running the application on the physical bug... (more) Resolved issue with running the application on the physical bug and using chainsaw viewer on the desktop ( remote machine ) to view logs. included comment in the code explaining how to setup SocketAppender. (collapse) | download |
| Version 6 | August 18th, 2009 | switch | I've added comment to explain more clearly what is going... (more) I've added comment to explain more clearly what is going on in the code. (collapse) | download |
| Version 5 | August 13th, 2009 | switch | good (more) good (collapse) | download |
| Version 4 | August 13th, 2009 | switch | (more) (collapse) | download |
| Version 3 | August 11th, 2009 | switch | (more) (collapse) | download |
| Version 2 | August 6th, 2009 | switch | still testing (more) still testing (collapse) | download |
| Version 1 | August 4th, 2009 | switch | (more) (collapse) | download |
| Viewing log4jExample | Link |
8 Comments |
|
clothworld said on January 5th, 2012 10:39:07 PM
clothworld said on January 5th, 2012 10:49:02 PM
clothworld said on January 5th, 2012 10:57:55 PM
clothworld said on January 6th, 2012 12:34:45 AM
clothworld said on January 11th, 2012 10:39:16 PM
clothworld said on January 13th, 2012 01:55:56 AM
clothworld said on January 13th, 2012 09:47:28 PM



jiushi said on December 26th, 2011 01:13:15 AM