on 02-06-2009 4:37 PM
Hallo,
I have tried to configure the logging in the wd project but something is wrong couse no file is written.
In the wdDoInit of my view x.y.z.view.GetRunnableProcessView I have put the following:
//directs log messages to a file
logger.addLog(new FileLog(wdContext.currentPropertyElement().getLogFilename()));
//set severity
logger.setEffectiveSeverity(Severity.ALL);
logger.entering("entering string");
logger.exiting("exiting string");
My log-configuration.xml is the following:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE log-configuration SYSTEM "log-configuration.dtd">
<log-configuration>
<log-controllers>
<log-controller
effective-severity="PATH"
name="x.y.z.view.GetRunnableProcessView"/>
</log-controllers>
</log-configuration>
In the visualAdmin >> Log Configuration Properties, the ForceSingleTraceFile is set to "NO".
The problem is that in the Log Configurator service in Visual admin I don't find my location tree and no log file is written.
Could somebody help me please?
Thanks,
regards
Andrea
Hallo,
the best way is to implement log4j. That is easy to implement and to configure.
Here is the link for download. http://logging.apache.org/log4j/1.2/download.html
Than you have to reference the log4j???.jar in your Application.
Next is to configure your properties (xml) file.
the root-logger level ERROR
log4j.rootLogger=ERROR, WD
now we attemp an appender to the conosole
log4j.appender.WD=org.apache.log4j.ConsoleAppender
#For this appende generade a Layout
log4j.appender.WD.layout=org.apache.log4j.PatternLayout
date shown in ISO-Format ISO-8601
log4j.appender.WD.layout.ConversionPattern=%d [%t] %-5p %c - %m%n
#for all class an packages "com.company.tests" the level DEBUG
log4j.logger.com.company.tests =DEBUG
********************
Implement this in your Application
PropertyConfigurator.configureAndWatch( "log4j.properties", 60*1000 );
put this in the begin others and end others
private static final Logger log = Logger.getLogger(<Your Company ControllerName>.class);
now you are able to log with
log.debug("Tests");
in your application
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
91 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.