Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

In Colored Trails Log4J is configured to log all log statements (debug and lower) to stdout.

An example

Every Java class in the CT code can use the log4J mechanism. An example:

Code Block
TitleLog4J example
import org.apache.log4j.Logger;

Logger logger = Logger.getLogger(this.getClass().getName());

logger.debug("Example log statement");

Logging to MySQL

Please note that the following instructions only concern the Colored Trails trunk

...

Code Block
sql
sql
CREATE TABLE `table_name` (
  `Id` int(11) NOT NULL auto_increment,
  `Logger` varchar(64) default NULL,
  `Priority` varchar(10) default NULL,
  `Message` varchar(250) default NULL,
  `Date` varchar(40) default NULL,
  PRIMARY KEY  (`Id`)
) ENGINE=MyISAM AUTO_INCREMENT=1005 DEFAULT CHARSET=utf8

An example

Every Java class in the CT code can use the log4J mechanism. An example:

Code Block
TitleLog4J example
import org.apache.log4j.Logger;

Logger logger = Logger.getLogger(this.getClass().getName());

logger.debug("Example log statement");