Home
Analytics
Server Log files ?
robilco
Hi All,<br />
<br />
To help diagnose an issue I'm having on a server, I'd like to turn BIRT logging up to the maximum and analyse all log files generated.<br />
<br />
The thing is, I can't see any log files created or any BIRT specific messages in the server log.<br />
<br />
My server is configured with JDK logging and Log4J<br />
<br />
In my logging.properties I have:<br />
<blockquote class='ipsBlockquote' ><p>
.level=FINEST<br />
handlers= java.util.logging.FileHandler, java.util.logging.ConsoleHandler, com.test.BIRTLogger<br />
org.eclipse.birt.level=FINEST<br /></p></blockquote>
<br />
In my log4j.properties I have:<br />
<blockquote class='ipsBlockquote' ><p>
log4j.rootCategory=TRACE, FILE, STDOUT<br />
log4j.category.org.eclipse.birt=TRACE<br /></p></blockquote>
<br />
The code for the configured handler above is just to log everything<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
package com.test;
import java.io.FileWriter;
import java.io.IOException;
import java.util.logging.Handler;
import java.util.logging.LogRecord;
import org.apache.log4j.Logger;
public class BIRTLogger extends Handler
{
FileWriter fw = null;
public void close() throws SecurityException
{
}
public void flush()
{
}
public boolean isLoggable(LogRecord record) {
{
return true;
}
public void publish( LogRecord record )
{
Logger log = Logger.getLogger( record.getLoggerName( ) );
String message = record.getMessage( );
//Just log everything to INFO level
log.info( message );
try {
fw.write(record.getLevel().toString() + " --- "+message);
} catch (IOException e) {
e.printStackTrace();
}
}
private FileWriter getFileWriter()
{
if ( fw == null ) {
synchronized (this) {
try {
fw = new FileWriter("~/BIRT.log", true);
} catch (IOException e) {
e.printStackTrace();
}
}
}
return fw;
}
}
</pre>
<br />
<br />
So, even with all this configuration, I don't get a single message to my standard log nor to the ~/BIRT.log file.<br />
<br />
Is there a specific environment variable I need to set to see logs output?<br />
<br />
Cheers,<br />
Ro
Find more posts tagged with
Comments
kclark
Take a look <a class='bbc_url' href='
http://wiki.eclipse.org/BIRT/FAQ/Deployment#Q:_Can_I_use_Log4j_with_BIRT.3F'>at
this log4j link</a> it may help with what your trying to do.
robilco
<blockquote class='ipsBlockquote' data-author="'kclark'" data-cid="110798" data-time="1350926942" data-date="22 October 2012 - 10:29 AM"><p>
Take a look <a class='bbc_url' href='
http://wiki.eclipse.org/BIRT/FAQ/Deployment#Q:_Can_I_use_Log4j_with_BIRT.3F'>at
this log4j link</a> it may help with what your trying to do.<br /></p></blockquote>
<br />
Yep - Thats the exact like I have been following (without any luck though), see the text in the sample matches mine exactly (except I added one "isLoggable" method)