A simple java global custom logger
Webneurons Web 3 | Java
  A simple java global custom logger. Source code for a basic java logger that just prints text to rotated log files. The logger can be called from any class in one line just like System.out.println().    

Webneurons Web 3 Home
Back
Page titles A-Z index
Main Pages
 Original Posting
 Original Site
 Newsgroup Post
 Web 3
 Wrong Approach
 XML
Reference
 Contact us


Java - Java is used to build the webneurons system. Apache and PHP are not needed since the system will include a server and the webneurons should replace PHP.


A simple java global custom logger. Source code for a basic java logger that just prints text to rotated log files. The logger can be called from any class in one line just like System.out.println().

The default java logging logger will send the log messages to System.out i.e. the console, and in a more complex format than you may want. You can redirect the output to a file but the default format is then XML. The below code allows you to send Log text messages that you choose to a file and nothing more.

You can send the log messages from any class anywhere by using Log.out("your message"); This is just like System.out.println("your message"); and uses a static method out() of the class Log.

You set the custom logger up once only at the start of the program using Log.setLog();

The logs will rotate 8 logs in total but you can change the total easily. The logs go to the user.home folder which you setup at the start using Settings.userHome("Your folder");