Updated SimpleLogger Class

The other day, someone emailed me and asked if I could add code to externalize the default values used by the SimpleLogger Class. I thought about it and figured it would be reasonably straight forward.

Hence, here are the JVM Environment variables that the SimpleLogger Class supports:

  • SimpleLogger.LogFileName – any valid file name
  • SimpleLogger.LogDirectory – any valid local directory
  • SimpleLogger.IncludePackageName – valid values are: true or false
  • SimpleLogger.LogLevel – valid values are: debug, info, warn or error
  • SimpleLogger.MaxBackupFiles – any valid integer
  • SimpleLogger.MaxFileSize – any valid integer
  • SimpleLogger.LogRotationType – valid values are: daily or size

I also added a new setLogFile method that takes no paramteres.

I have generated the JavaDocs for the SimpleLogger class and created a JAR file for SimpleLogger for users to use. I zipped up the JavaDocs, JAR file and the source code for both Test_SimpleLogger.java program and SimpleLogger.java. You can download the it from here.

Simply add the SimpleLogger JAR file to your application or add the SimpleLogger source code to your utility (or handler) package of your application and then start using it.

Regards,
Roger Lacroix
Capitalware Inc.

This entry was posted in Capitalware, HPE NonStop, IBM i (OS/400), Java, JMS, Linux, macOS (Mac OS X), Open Source, Programming, Raspberry Pi, Unix, Windows.

Comments are closed.