001// Copyright 2006 by Basil Vandegriend. All rights reserved. 002 003package com.basilv.examples.logging; 004 005import org.apache.log4j.Logger; 006 007public class LogExample 008{ 009 private static Logger logger = Logger 010 .getLogger(LogExample.class); 011 012 void doWork() { 013 logger.debug("Debugging message"); 014 try { 015 logger.info("Info message"); 016 } catch (RuntimeException e) { 017 logger.error( 018 "Error message with exception included.", e); 019 throw e; 020 } 021 } 022}