14.07.2013 Views

Contents - Cultural View

Contents - Cultural View

Contents - Cultural View

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

SLAMD Server 275<br />

SLAMD Server<br />

A SLAMD Server is a server supported by an application server that services SLAMD clients and SLAMD jobs.<br />

SLF4J<br />

Developer(s) Ceki Gülcü<br />

Stable release 1.6.1 / July 5, 2010<br />

Written in Java<br />

Operating<br />

system<br />

Cross-platform<br />

Type Logging Tool<br />

License MIT License<br />

Website http:/ / www. slf4j. org/<br />

Simple Logging Facade for Java (SLF4J) provides a Java logging API by means of a simple facade pattern. The<br />

underlying logging backend is determined at deployment time and includes java.util.logging [1] , log4j and logback.<br />

The separation of the client API from the logging backend reduces the coupling between an application and any<br />

particular logging framework. This can make it easier to integrate with existing or third-party code or to deliver code<br />

into other projects that have already made a choice of logging backend.<br />

SLF4J was created by Ceki Gülcü as a more reliable alternative to Jakarta Commons Logging framework.<br />

Similarities and Differences with Log4j<br />

• Five of Log4j's six logging levels are used. FATAL has been dropped on the basis that inside the logging<br />

framework is not the place to decide when an application should terminate and therefore there is no difference<br />

between ERROR and FATAL from the logger's point of view.<br />

• Logger instances are created via the LoggerFactory, which is very similar in Log4j. For example,<br />

private static final Logger LOG =<br />

LoggerFactory.getLogger(Wombat.class);<br />

• In Logger [2] , the logging methods are overloaded with forms that accept one, two or more values. Occurrences of<br />

the simple pattern {} in the log message is replaced in turn with the values. This is simple to use yet provides a<br />

performance benefit when the values have expensive toString() methods. When logging is disabled at the<br />

DEBUG level, the logging framework does not need to evaluate the string representation of the values. In the<br />

following example, the values count or userAccountList only need to be evaluated when DEBUG is<br />

enabled; otherwise the overhead of the debug call is trivial.<br />

LOG.debug("There are now " + count + " user accounts: " +<br />

userAccountList); // slow<br />

LOG.debug("There are now {} user accounts: {}", count,<br />

userAccountList); // faster<br />

• Similar methods exist in Logger [2] for isDebugEnabled() etc to allow more complex logging calls to be<br />

wrapped so that they are disabled when the corresponding level is disabled, avoiding unnecessary processing.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!