Logging via logbox into obj.log_entry

Hi,

i wanted to do some logging and have seen, that logbox is already included into preside and there’s already an an object (psys_log_entry) and a logging/PresideDbAppender.cfc.

Unfortunately I can’t see how I need to set the appender and do some logging into this object. Any example available?

Thanks.

logbox is configured in Config.cfc:

conf.logbox.categories.mylogger = {
	  appenders = 'presideDbLogAppender'
	, levelMin  = "FATAL"
	, levelMax  = "INFO"
};

Then use somewhere:

property name="logger" inject="logbox:mylogger";

// ...

logger.info( "hello world" );
1 Like

Too simple for me facepalm.

Thanks a lot.

You can also output the logs with:

#dbLogTable( category="mylogger" )#
1 Like