RE: AsyncAppender ...

2003-09-25 Thread Thomas Muller
| Hi, | | I am fairly new to Log4J and I have the following questions. | | By default if I use the ConsoleAppender or any other appender other | than AysncAppender, they are all synchronous. Correct? Yes. | 1. To use the appender in an aysnc way, I have to extend it from the |

RE: how do I log an exception stacktrace

2003-08-29 Thread Thomas Muller
... } catch( Exception e ) { logger.debug( e.getMessage(), e ); } ... -- Thomas | -Original Message- | From: Andreas Bothner [ MTN - Innovation Centre ] | [mailto:[EMAIL PROTECTED] | Sent: 29 August 2003 14:55 | To: Log4J Users List | Subject: how do I log an exception

RE: how to catch exception messages in log4j.

2003-08-14 Thread Thomas Muller
http://jakarta.apache.org/log4j/docs/index.html -- Thomas | -Original Message- | From: nraokonjeti [mailto:[EMAIL PROTECTED] | Sent: 06 August 2003 12:20 | To: [EMAIL PROTECTED] | Subject: how to catch exception messages in log4j. | | | hi all, | I have one application. I have to

RE: SocketAppender issue

2003-07-18 Thread Thomas Muller
Sudhakar, The javadoc for org.apache.log4j.net.SocketServer clearly states that you may have a configuration file for each client that connects to it, and if not present a generic configuration file is applied. Hope this helps, -- Thomas | -Original Message- | From: Satrasala,

RE: Reading events

2003-07-18 Thread Thomas Muller
The LoggingEvent implements the java.io.Serializable interface, so you're free to dump it to any storage media of your discretion and read it back as a java object. The SocketAppender uses this technique already; the LoggingEvents are serialised and streamed over a socket to a SocketServer. It's

Multiple hiearchies and configuration files

2003-07-17 Thread Thomas Muller
Log4j gurus, I'm using multiple hierarchies and configuration files. The additional hierarchies (seen from the main hierarchy which is configured during startup) read configuration from several XML configuration files. Only the first file they read has a root Logger and an inherent appender.

RE: log4j ObjectRenderer.

2003-07-14 Thread Thomas Muller
From the PropertyConfigurator javadoc: You can customize the way message objects of a given type are converted to String before being logged. This is done by specifying an ObjectRenderer for the object type would like to customize. The syntax is:

RE: File locking in FileAppender

2003-07-14 Thread Thomas Muller
Milin, | Thanks for the quick response. I don't see anything specifically | written about file locking in the java.io.Writer. Of course not. java.io.Writer is a generic (abstract) character emitter and leaves the media specifics to the subclasses, such as FileWriter. I wanted to draw your

RE: Multiple configuration files - single contra multiple hierarchies

2003-07-02 Thread Thomas Muller
web: http://www.ubis-ag.com | --- | | -Ursprüngliche Nachricht- | Von: Thomas Muller [mailto:[EMAIL PROTECTED] | Gesendet: Montag, 30. Juni 2003 17:44 | An: [EMAIL PROTECTED] | Betreff: Multiple configuration files - single contra multiple | hierarchies | | | Fellow Log4j users

Multiple configuration files - single contra multiple hierarchies

2003-06-30 Thread Thomas Muller
Fellow Log4j users, Would appreciate some input on how to design a solution for a problem I'm facing regarding multiple Log4j configuration files. One of the modules in our system (the module consists of a significant number of classes) is in the process of being redesigned such that the system

RE: log4j.xml and variable substitution

2003-01-16 Thread Thomas Muller
You need to set the relevant System variable prior to log4j configuration, e.g. with the -D option to the VM. -- Thomas | -Original Message- | From: Jenny [mailto:[EMAIL PROTECTED]] | Sent: 16 January 2003 17:54 | To: Log4J Users List | Subject: Re: log4j.xml and variable

RE: What jar(s) I need from Sun to do SMTPAppender

2003-01-16 Thread Thomas Muller
You need the JavaBeans Activation Framework (JAF)(activation.jar). Downloadable from http://java.sun.com/products/javabeans/glasgow/jaf.html. Hope this helps, -- Thomas | -Original Message- | From: Wilfred Ho [mailto:[EMAIL PROTECTED]] | Sent: 16 January 2003 18:03 | To: [EMAIL

RE: log4j.xml and variable substitution

2003-01-16 Thread Thomas Muller
. | | Thanks. | | --- Thomas Muller [EMAIL PROTECTED] wrote: | You need to set the relevant System variable prior | to log4j configuration, | e.g. with the -D option to the VM. | | -- | | Thomas | | | | | | -Original Message- | | From: Jenny [mailto:[EMAIL PROTECTED]] | | Sent: 16

RE: How to give relative log file path -RollingFileAppender

2003-01-16 Thread Thomas Muller
| 1. How do i specify a relative path to this file name, so that it can be | created under j2ee/home/log/test.log. This j2ee/home may be under some | other top level dir ? Before log4j is configured, insert the application server home path in the System properties, e.g. System.setProperty(

RE: How to give relative log file path -RollingFileAppender

2003-01-16 Thread Thomas Muller
| 1. My first issue is, how does it gets this path, based on what | nbsp;system parameter | it takes up this value /j2ee/home/ and prepend it to log file ? The /j2ee/home is probably the VMs current working directory, this is why you find your files under this directory (unless you have specified

RE: User-level filtering

2003-01-07 Thread Thomas Muller
MDC and NDC are your friends. -- Thomas | -Original Message- | From: Lutz Michael [mailto:[EMAIL PROTECTED]] | Sent: 07 January 2003 18:20 | To: 'Log4J Users List' | Subject: User-level filtering | | | | | Has anyone by any chance figured out a slick way to implement user-level |

RE: User-level filtering

2003-01-07 Thread Thomas Muller
classes with the same fully qualified class name used across an | application's business functions. | | | | | -Original Message- | From: Thomas Muller [mailto:[EMAIL PROTECTED]] | Sent: Tuesday, January 07, 2003 1:22 PM | To: Log4J Users List | Subject: RE: User-level filtering | | | MDC and NDC

RE: Running out of memory using AsyncAppender

2003-01-03 Thread Thomas Muller
Selwyn, Have you considered increasing the stack/heap size? Read the documentaion for the -Xmx -Xss java JVM options. The problem with AsyncAppender is that it runs in a one-per-instance thread and it has a fixed buffer size. A more effective AsyncAppender would share a single thread (or maybe

RE: Running out of memory using AsyncAppender

2003-01-03 Thread Thomas Muller
| How many AsyncAppenders are you running? Many. | A more effective AsyncAppender would share a | single thread (or maybe use a thread pool) between all | instances. It would | also use a linked list for storing log events instead of a fixed size | buffer. This would also solve another issue the

RE: Running out of memory using AsyncAppender

2003-01-03 Thread Thomas Muller
Selwyn, I don't think the out-of-memory error is related to Log4j's AsyncAppender (of anything in Log4j for that matter). As long as you don't explicitly increase the buffersize, it's memory consumption should be constant. Are you creating appenders programmatically? In case you are, my guess is

RE: setting a directory to the file in one of the file-appenders

2002-12-19 Thread Thomas Muller
Both PropertyConfigurator and DOMConfigurator support rudimentary variable interpolation from the System properties. java -Dmylog.dir=/usr/home/foo/log Foo.java And in your config file: appender name=FOO_APPENDER class=org.apache.log4j.FileAppender param name=File

RE: How to use the CompositeRollingAppender ?

2002-12-18 Thread Thomas Muller
Rami, First: please use plain text _only_ for mailing-list and Usenet postings. The way to configure CompositeRollingAppender (and all other appenders) is to use the mutator methodnames in your configuration file. If the class e.g. describes setFeatureFoo( int foo ), your configuration file may

RE: Changing logger configuration at runtime

2002-12-09 Thread Thomas Muller
DOMConfigurator.configureAndWatch() is your friend. -- Thomas | -Original Message- | From: Kohinoor Lal Verma (EHS) [mailto:[EMAIL PROTECTED]] | Sent: 09 December 2002 14:02 | To: 'Log4J Users List' | Subject: Changing logger configuration at runtime | | | Hi all, | | Can someone tell

RE: AsyncAppender only with XML file?

2002-12-09 Thread Thomas Muller
| Is it true? Yes. If you consult the javadoc for org.apache.log4j.AsyncAppender in log4j, you will find the statement: Important note: The AsyncAppender can only be script configured using the DOMConfigurator. Hope this helps. -- Thomas

RE: Identification of log name

2002-12-05 Thread Thomas Muller
| We have a java class that calls | Logger.getLogger(Main.class); | | Am i correct in assuming the logfile would be main.log No. Read the Log4j documentation at http://jakarta.apache.org/log4j/docs/documentation.html. -- Thomas

RE: can each thread has a logfile?

2002-12-03 Thread Thomas Muller
Li, As far as I understand log4j has no built-in mechanism aimed at facilitating what you ask for, but it's not hard to code this functionality yourself. You can e.g. use java.lang.ThreadLocal. public class Foo { private static final ThreadLocal THREAD_LOCAL_LOGGER = new ThreadLocal() {

RE: HTML Layout

2002-11-29 Thread Thomas Muller
No - but feel free to write a formatting flexible HTMLLayout and submit it! -- Thomas | -Original Message- | From: Graham Mead [mailto:[EMAIL PROTECTED]] | Sent: 29 November 2002 15:46 | To: [EMAIL PROTECTED] | Subject: HTML Layout | | | Hi, | | We need to output logging info in HTML

RE: Object logger

2002-11-29 Thread Thomas Muller
| It should be a logger that takes a serializable object and serializes it | to the appender. Then when an exception occurs we can go back and see | the actual state of the objects as they where when the exception | occurred. | Does it exists and if not, what do you think of the idea? I think

RE: Using NDC

2002-11-27 Thread Thomas Muller
From the Log4j javadoc (NDC class): The NDC class implements nested diagnostic contexts as defined by Neil Harrison in the article Patterns for Logging Diagnostic Messages part of the book Pattern Languages of Program Design 3 edited by Martin et al. Addison-Wesley Pub Co; ISBN: 0201310112; 1st

RE: A few Async appender related questions

2002-11-27 Thread Thomas Muller
| 1. Is there a way to monitor the queue of the async appender ? Not without modifying the code. | 2. If an Async appender is writting to a socket appender and if there is a | network issue and the queue gets full, is there a way to | overwirte the queue | rather than block the user (not

RE: Connecting one Appender to several Loggers

2002-11-27 Thread Thomas Muller
Appenders should be thread-safe, hence a single appender can be added to multiple loggers. -- Thomas | -Original Message- | From: Wolfgang Stein [mailto:[EMAIL PROTECTED]] | Sent: 27 November 2002 16:36 | To: [EMAIL PROTECTED] | Subject: Connecting one Appender to several Loggers | |

RE: Initialization Question

2002-11-21 Thread Thomas Muller
Log4j has supported system properties interpolation in XML/properties configuration files at least since I started using it (almost two years ago). Just add the variables to system properties before Log4j fires up, e.g. with the -D option to the VM. -- Thomas | -Original Message- |

RE: Exemple ObjectRenderer ?

2002-11-18 Thread Thomas Muller
package my.package; public class FooRenderer implements org.apache.log4j.or.ObjectRenderer { public String doRender( Object fooInstance ) { return( foo instance is [ + fooInstance + ] ); } } In your XML config file: renderer renderedClass=my.package.Foo

RE: Basic Doubt in log4j

2002-11-11 Thread Thomas Muller
You find a short introduction to Log4j here: http://jakarta.apache.org/log4j/docs/manual.html A commercial manual can be found here: http://www.flashline.com/components/view.jsp?prodid=4702affiliateid=657173 Also, you should peruse the javadoc of the vital classes in Log4j, such as Logger,

SnmpAppender extention suggestion (was: RE: Joe SNMP facade bug)

2002-10-15 Thread Thomas Muller
Add interface: public abstract interface SysupTimeResolver { public abstract long getSysupTime(); } Add the following to SNMPAppender: private static final SysupTimeResolver DEFAULT_SYSUP_TIME_RESOLVER = new SysupTimeResolver() { long time = System.currentTimeMillis();

RE: SnmpAppender extention suggestion (was: RE: Joe SNMP facade bug)

2002-10-15 Thread Thomas Muller
and of course, remove the setSysupTime() etc. This is rarely used anyway since one generally don't want to keep track of actual appenders and specially not in form of their types (in this case SNMPAppender). -- Thomas | -Original Message- | From: Thomas Muller [mailto:[EMAIL

RE: Newbie help

2002-10-11 Thread Thomas Muller
| I'm trying to get my jsp to work with log4j, I need to know how to set | up the log4j properties file to log to a file. | Can someone provide a example ? Thanks. http://jakarta.apache.org/log4j/docs/manual.html -- Thomas

RE: Anyone remeber LogFactor5 ?

2002-10-11 Thread Thomas Muller
It's included in Log4j now. See package org.apache.log4j.lf.* under the source directory. -- Thomas | -Original Message- | From: Whiting, Jeremy [mailto:[EMAIL PROTECTED]] | Sent: 11 October 2002 11:18 | To: '[EMAIL PROTECTED]' | Subject: Anyone remeber LogFactor5 ? | | | Hi, | I'm

RE: Relative path for FileAppender File

2002-10-02 Thread Thomas Muller
| I have an environment variable called CATALINA_HOME that contains | D:/Tomcat4.1 You need to set the variable in the System properties. Environment or shell variables are _not_ automatically or magicly transferred to the java properties. Either start the VM with the -D option (e.g.

RE: Relative path for FileAppender File

2002-10-02 Thread Thomas Muller
- | From: Thomas Muller [mailto:[EMAIL PROTECTED]] | Sent: Wednesday, October 02, 2002 11:07 AM | To: Log4J Users List | Subject: RE: Relative path for FileAppender File | | | | I have an environment variable called CATALINA_HOME that contains | | D:/Tomcat4.1 | | You need to set the variable

RE: Name of rolled over files

2002-09-23 Thread Thomas Muller
Actually, I would think the best thing to do is to allow an implementation of an interface to be given in the configuration. This is quite in accordance to how other parts of Log4j is configured, e.g. renderers and filters. The interfact could be something like this: public abstract interface

RE: Name of rolled over files

2002-09-23 Thread Thomas Muller
); | | } | | greetings, thomas | | -Ursprüngliche Nachricht- | Von: Thomas Muller [mailto:[EMAIL PROTECTED]] | Gesendet: Montag, 23. September 2002 16:25 | An: Log4J Users List | Betreff: RE: Name of rolled over files | | | Actually, I would think the best thing to do is to allow

RE: DailyRollingFileAppender does not create backup file

2002-09-04 Thread Thomas Muller
Keep in mind that the DailyRollingFileAppender is not supposed to roll over exactly at the time specified, merely at the first log-event that occurrs after that time is passed. The reason is simply that the rollover is handled in the same thread as the logging occurrs. -- Thomas |

RE: Where does it look for configuration files?

2002-09-03 Thread Thomas Muller
| Specifically I would like to know where it looks for the file when only a | file name (and not a full path) is specified like john.txt instead of | C:\john.txt. Probably current user directory (see System.getProperty( user.dir ) ). -- Thomas

RE: How to set additivity flag by coniguratio file

2002-09-03 Thread Thomas Muller
| Is it possible to set additivity flag in the configuration file instead of | setting it into code. Yes, see http://jakarta.apache.org/log4j/docs/manual.html. -- Thomas * Copyright ERA Technology Ltd. 2002.

RE: Example of variable substitution in an XML formatted config file

2002-08-20 Thread Thomas Muller
DOMConfigurator supports rudimentary variable interpolation. Variables found in the System properties can be used in the XML config file like this: appender name=FOO class=org.apache.log4j.DailyRollingFileAppender param name=file value=${log.home}/foo.log / param name=append

RE: [no class and line will logged]

2002-08-15 Thread Thomas Muller
Make sure that you compile the application with the debug info intact. If you use Sun's compiler, the -g option controls this. Also, some appenders require the locationInfo parameter to be set to true to carry over class/method/line information. Last, JIT compilation might optimize location

RE: How to make logging in another file for each day?

2002-08-15 Thread Thomas Muller
org.apache.log4j.DailyRollingFileAppender is your friend. -- Thomas | -Original Message- | From: Maksims Markaitis [mailto:[EMAIL PROTECTED]] | Sent: 15 August 2002 11:25 | To: 'Log4J Users List' | Subject: How to make logging in another file for each day? | | | How to make

RE: filtered exception logging

2002-07-29 Thread Thomas Muller
I think this could be a good feature, but I guess will have to code it yourself. You could write your own Layout class or extend e.g. PatternLayout. Let ignoresThrowable() return false, and handle the throwable yourself. You will have to construct the magic that filters the lines, maybe by

RE: HTML - my own html

2002-07-04 Thread Thomas Muller
Robert, A glimpse at the sourcecode reveals that the HTMLAppender mercilessly converts the brackets. sbuf.append( Transform.escapeTags( event.getRenderedMessage() ) ); Inserting HTML code in the log message strikes me as a bad idea in the first place, actually, log messages should

RE: Newbie filtering

2002-07-03 Thread Thomas Muller
| Firstly I can not find any where a description of how to configure Log4j | using a XML file instead of a property file. You will find examples in the LOG4j_HOME/src/java/org/apache/log4j/xml/examples. Also have a look at the LOG4j_HOME/src/java/org/apache/log4j/xml/log4j.dtd file. |

RE: Correction!! (was: RE: XMLLayout conversion pattern)

2002-07-02 Thread Thomas Muller
have an example you can share? Thanks. | -billc | | -Original Message- | From: Thomas Muller [mailto:[EMAIL PROTECTED]] | Sent: Monday, July 01, 2002 2:01 PM | To: Log4J Users List | Subject: Correction!! (was: RE: XMLLayout conversion pattern) | | Perusing the code you can see

RE: XMLLayout conversion pattern

2002-07-01 Thread Thomas Muller
Try to set param name=LocationInfo value=true / for the appender you're using. -- Thomas | -Original Message- | From: Christian, William [mailto:[EMAIL PROTECTED]] | Sent: 01 July 2002 18:26 | To: Log4J Users List | Subject: XMLLayout conversion pattern | | | How

Correction!! (was: RE: XMLLayout conversion pattern)

2002-07-01 Thread Thomas Muller
Perusing the code you can see that you will have to set LocationInfo *for the actual Layout* in order to get class/method/line information. If you're using SMTPAppender you're adviced to set LocationInfo for the appender as well. -- Thomas | -Original Message- | From: Thomas Muller

RE: creating log file for each user

2002-07-01 Thread Thomas Muller
NDC and MDC are lightweith variants of what you want to achieve; that is, you can assign a unique id to each log event (e.g. a username), and filter/sort based on this id when perusing the log. Another alternative is to create/get/restore an Appender programmatically for each individual user.