Posts Tagged ‘Logging’
How to Change the Log Level of CamelEdge 1.0 in Progress FUSE ESB 4.1
1) Add the following line to <Install Dir>/etc/org.ops4j.pax.logging.cfg:
log4j.category.CamelEdge=WARN
2) Restart the ESB.
This version is noisy in INFO and DEBUG modes.
Verbose Default Logging in JBossESB 4.6
I’d suggest limiting the categories below in jboss-log4j.xml.
<category name="com.arjuna.ats"> <priority value="INFO" /> </category> <category name="org.hibernate"> <priority value="INFO" /> </category> <category name="org.jbosson.plugins.jbossesb"> <priority value="INFO" /> </category> <category name="org.jbpm"> <priority value="INFO" /> </category> <category name="org.jboss.remoting"> <priority value="INFO" /> </category> <category name="org.jboss.ws"> <priority value="INFO" /> </category> <category name="org.jboss.wsf"> <priority value="INFO" /> </category> <category name="org.rhq"> <priority value="INFO" /> </category>
You may also want to edit the existing entry and set the org.jboss category to INFO.
Logging with JBossAS
Using Apache Commons Logging or Log4j with Custom Services
log4j Roadmap
However, it doesn’t seem likely that log4j 1.3 will ever been sufficiently compatible with log4j 1.2 to recommend it as a general replacement for log4j 1.2.
Oh, really?
[log4j 2.0] would include a facade that emulates the log4j 1.3 API but would not be compatible with user written appenders and other components.
What do the dogged open-source advocates have to say?
My Favorite Logging Packages
Jakarta Commons Logging, compared to Log Bridge and SLF4J, and log4j, compared to the Java Logging API, Simple Log, jLo, x4juli and Protomatter Syslog.
How to Use Protomatter Syslog
1) Create the SyslogSample.java file:
import com.protomatter.syslog.Syslog;
import com.protomatter.syslog.Syslogger;
public final class SyslogSample {
public static void main(final String[] args) throws Exception {
final Syslogger logger = Syslog.getLogger(SyslogSample.class.getName());
Syslog.info(logger, "Hello World!");
}
private SyslogSample() {
}
}
2) Create the syslog.xml file:
<?xml version="1.0" encoding="UTF-8"?>
<Syslog defaultMask="DEBUG">
<Logger name="PrintWriterLog.out" class="com.protomatter.syslog.PrintWriterLog">
<Policy class="com.protomatter.syslog.SimpleLogPolicy">
<channels>ALL_CHANNEL</channels>
<logMask>INFO</logMask>
</Policy>
<stream>System.out</stream>
</Logger>
</Syslog>
3) Compile the SyslogSample.java file.
4) Set the Syslog.config.xml system property to syslog.xml.
5) Launch the SyslogSample class.
How to Use x4juli
1) Create the X4JuliSample.java file:
import java.util.logging.Logger;
public final class X4JuliSample {
public static void main(final String[] args) {
final Logger logger = Logger.getLogger(X4JuliSample.class.getName());
logger.info("Hello World!");
}
private X4JuliSample() {
}
}
2) Compile the X4JuliSample.java file.
3) Set the java.util.logging.manager system property to org.x4juli.X4JuliLogManager.
4) Launch the X4JuliSample class.
LOGBack
The next generation of log4j.
How to Use jLo
1) Create the JloSample.java file:
import org.jzonic.jlo.Logger;
import org.jzonic.jlo.LogManager;
public final class JloSample {
public static void main(final String[] args) {
final Logger logger = LogManager.getLogger(JloSample.class.getName());
logger.info("Hello World!");
}
private JloSample() {
}
}
2) Create the jlo.properties file:
processor=direct
3) Compile the JloSample.java file.
4) Launch the JloSample class.

