Is there a way to access the logger from a class not extending baseplugin or any of the managed API's?
Is there a way to access the logger from a class not extending baseplugin or any of the managed API's?
Last edited by tcarr; 07-18-2011 at 06:02 PM. Reason: question was answered
The simplest way is to have the plugin pass a Logger variable (getApi().getLogger()) or an ElectroServerApi variable (getApi()).
The usual practice is to use
If you use the second, you will need to modify server/config/log4j.properties to set the logging level. See Logging.Code:import org.slf4j.Logger; import org.slf4j.LoggerFactory; private static final Logger logger = LoggerFactory.getLogger(NAME_OF_JAVA_CLASS_HERE.class);
Last edited by tcarr; 07-18-2011 at 05:55 PM.
Teresa Carrigan
Senior Engineer
Electrotank, Inc.
jproffer (07-18-2011)
Ahh. I had the second method implemented but it was not showing anything, so was wondering what I missed. Looks like it was the log4j.propertiesThanks!
If you have questions about how to configure log4j.properties, you know where to find me.![]()
Teresa Carrigan
Senior Engineer
Electrotank, Inc.
yeah it was easy to figure out, I got it working, thanks very much!