Posts Tagged ‘Logging’
How to Change the Log Level of upic-openedge 1.0 in Apache ServiceMix
1) Add the following line to <Install Dir>/etc/org.ops4j.pax.logging.cfg:
log4j.category.upic-openedge=WARN
2) Restart the ESB.
Improvement to SLF4J 1.6.2
ServiceLoader looks like a good step forward.
Logging with JBossAS
We are in the Russian Wikipedia
Wow, this is fun.
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 JUL 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.