Simples Assim

Posts Tagged ‘Logging

How to Use jLo

leave a comment »

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.

http://sourceforge.net/projects/jlo/

Written by Fernando Ribeiro

May 25, 2006 at 1:06 am

Posted in Software

Tagged with

How to Use SLF4J with log4j

with 3 comments

1) Create the Slf4jSample.java file:

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public final class Slf4jSample {

  public static void main(final String[] args) {
    final Logger logger = LoggerFactory.getLogger(Slf4jSample.class);

    logger.info("Hello World!");
  }

  private Slf4jSample() {
  }

}
2) Create the log4j.properties file:

log4j.appender.A1=org.apache.log4j.ConsoleAppender
log4j.appender.A1.layout=org.apache.log4j.PatternLayout

log4j.logger.Slf4jSample=INFO, A1

3) Compile the Slf4jSample.java file.

4) Add the slf4j-log4j.jar file to the class path.

5) Launch the Slf4jSample class.

http://www.slf4j.org/

Written by Fernando Ribeiro

May 24, 2006 at 11:05 pm

Posted in Software

Tagged with

How to Use Log Bridge with log4j

leave a comment »

1) Create the LogBridgeSample.java file:

import org.grlea.logBridge.LogBridge;
import org.grlea.logBridge.LogBridgeManager;

public final class LogBridgeSample {

  public static void main(final String[] args) {
    final LogBridge bridge = LogBridgeManager.createLogBridge(LogBridgeSample.class);

    bridge.info("Hello World");
  }

  private LogBridgeSample() {
  }

}
2) Create the logBridge.properties file:

org.grlea.logBridge.LogBridgeFactory=org.grlea.logBridge.impl.Log4JLogBridgeFactory # default is org.grlea.logBridge.impl.NullLogBridgeFactory

3) Create the log4j.properties file:

log4j.appender.A1=org.apache.log4j.ConsoleAppender
log4j.appender.A1.layout=org.apache.log4j.PatternLayout

log4j.logger.LogBridgeSample=INFO, A1

4) Compile the LogBridgeSample.java file.

5) Launch the LogBridgeSample class.

https://log-bridge.dev.java.net/

Written by Fernando Ribeiro

May 23, 2006 at 10:39 pm

Posted in Software

Tagged with

How to Use Simple Log

leave a comment »

1) Create the SimpleLogSample.java file:

import org.grlea.log.SimpleLogger;

public final class SimpleLogSample {

  public static void main(final String[] args) {
    final SimpleLogger logger = new SimpleLogger(SimpleLogSample.class);

    logger.info("Hello World");
  }

  private SimpleLogSample() {
  }

}

2) Create an empty simplelog.properties file.

3) Compile the SimpleLogSample.java file.

4) Launch the SimpleLogSample class.

https://simple-log.dev.java.net/

Written by Fernando Ribeiro

May 23, 2006 at 10:17 pm

Posted in Software

Tagged with

How to Use Jakarta Commons Logging with log4j

leave a comment »

1) Create the CommonsSample.java file:

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

public final class CommonsSample {

  public static void main(final String[] args) {
    final LogFactory factory = LogFactory.getFactory();

    final Log log = factory.getInstance(CommonsSample.class);

    log.info("Hello World!");
  }

  private CommonsSample() {
  }

}

2) Create the commons-logging.properties file:

org.apache.commons.logging.Log=
org.apache.commons.logging.impl.Log4JLogger # default is org.apache.commons.logging.impl.SimpleLog

3) Create the log4j.properties file:

log4j.appender.A1=org.apache.log4j.ConsoleAppender
log4j.appender.A1.layout=org.apache.log4j.PatternLayout

log4j.logger.CommonsSample=INFO, A1

4) Compile the CommonsSample.java file.

5) Launch the CommonsSample class.

http://jakarta.apache.org/commons/logging/

Written by Fernando Ribeiro

May 22, 2006 at 10:07 pm

Posted in Software

Tagged with

How to Use Chainsaw

leave a comment »

1) Create the ChainsawSample.java file:

import org.apache.log4j.Logger;

public final class ChainsawSample {

  public static void main(final String[] args) {
    final Logger logger = Logger.getLogger(ChainsawSample.class);

    logger.info("Hello World!");
  }

  private ChainsawSample() {
  }

}

2) Create the log4j.properties file:

log4j.appender.A1=org.apache.log4j.net.SocketAppender
log4j.appender.A1.layout=org.apache.log4j.PatternLayout
log4j.appender.A1.RemoteHost=localhost # use the default port

log4j.logger.ChainsawSample=INFO, A1

3) Compile the ChainsawSample.java file.

4) Launch Chainsaw.

5) Launch the ChainsawSample class.

http://logging.apache.org/log4j/docs/chainsaw.html

Written by Fernando Ribeiro

May 22, 2006 at 8:58 pm

Posted in Software

Tagged with

How to Use log4j

leave a comment »

1) Create the Log4jSample.java file:

import org.apache.log4j.Logger;

public final class Log4jSample {

  public static void main(final String[] args) {
    final Logger logger = Logger.getLogger(Log4jSample.class);

    logger.info("Hello World!");
  }

  private Log4jSample() {
  }

}
2) Create the log4j.properties file:

log4j.appender.A1=org.apache.log4j.ConsoleAppender
log4j.appender.A1.layout=org.apache.log4j.PatternLayout

log4j.logger.Log4jSample=INFO, A1

3) Compile the Log4jSample.java file.

4) Launch the Log4jSample class.

http://logging.apache.org/log4j/

Written by Fernando Ribeiro

May 22, 2006 at 7:42 pm

Posted in Software

Tagged with

How to Use Logfeeder

leave a comment »

1) Create the LogfeederSample.java file:

import java.util.logging.Logger;

public final class LogfeederSample{

  public static void main(final String[] args) {
    final Logger logger = Logger.getLogger(LogfeederSample.class.getName());

    logger.info("Hello World!");
  }

  private LogfeederSample() {
  }

}
2) Create the logging.properties file:

java.util.logging.SocketHandler.host=localhost
java.util.logging.SocketHandler.port=4446 # no default

LogfeederSample.handlers=java.util.logging.SocketHandler

3) Compile the LogfeederSample.java file.

4) Launch Logfeeder.

5) Launch the LogfeederSample class.

http://www.puzzlecode.com/puzzlecode/logfeeder

Written by Fernando Ribeiro

May 22, 2006 at 11:30 am

Posted in Software

Tagged with

How to Use the JUL API

leave a comment »

1) Create the LoggingSample.java file:

import java.util.logging.Logger;

public final class LoggingSample{

  public static void main(final String[] args) {
    final Logger logger = Logger.getLogger(LoggingSample.class.getName());

    logger.info("Hello World!");
  }

  private LoggingSample() {
  }

}
2) Compile the LoggingSample.java file.

3) Launch the LoggingSample class.

Written by Fernando Ribeiro

May 22, 2006 at 8:05 am

Posted in Software

Tagged with

Enterprise AOP

leave a comment »

The project also provides and demonstrates effective use of a proposed common support library for AspectJ, which provides flexible support for exception handling, security, logging, tracing, transaction and persistent session management, and virtual mock objects for testing. This library will allow Java projects to implement significant new functionality with just a few lines of code. Further, it will substantially reduce the learning curve to productively apply AOP.

http://www.oreillynet.com/pub/wlg/4222

Written by Fernando Ribeiro

January 27, 2004 at 7:58 pm

Posted in Software

Tagged with

Follow

Get every new post delivered to your Inbox.

Join 784 other followers