Re: Log4J doesn't work at all

2012-04-10 Thread Michael Erskine
On 10 April 2012 12:27, Michael Erskine wrote: > I know this might sound daft but is your class actually trying to log > anything? OK, I see where you're coming from: http://hc.apache.org/httpcomponents-client-ga/logging.html ...and you would expect the HttpClient to log to the c

Re: Log4J doesn't work at all

2012-04-10 Thread Michael Erskine
I know this might sound daft but is your class actually trying to log anything? - To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org For additional commands, e-mail: log4j-user-h...@logging.apache.org

Re: How to delete individual entries from a log file

2011-12-16 Thread Michael Erskine
Rather than your log file processor removing items from a log file, have _it_ log the items that it _has_ re-indexed! - To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org For additional commands, e-mail: log4j-user-

Re: JVM crash with Log4J.

2010-04-08 Thread Michael Erskine
27;t suggest anything more than that without doing your job for you :) Regards, Michael Erskine. - To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org For additional commands, e-mail: log4j-user-h...@logging.apache.org

Re: JVM crash with Log4J.

2010-04-08 Thread Michael Erskine
ity. That is what happened. Unless the logs are somehow fabricated :) The cause of the crash however could be anything! Have a try at repeating it by dropping newer Wars and Jars. Upgrade your Java runtime to apply all the officially available fixes. Quit running Tomcat as root :) Regards, Mich

Re: JVM crash with Log4J.

2010-04-07 Thread Michael Erskine
nce for each HTTP daemon? Is this something to do with... -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager Does this Log4j configuration usually work? Have you tried running on a recent version of Java 6? Regards, Michael Erskine.

Re: Log4j Count the number of record with timestamp

2010-03-24 Thread Michael Erskine
erging ugly category of "Let's try and get Log4j to billions of jobs that are already done perfectly by other tools". Seriously, does nobody know how to use cron and logrotate any more? Regards, Michael Erskine. -

Re: Creating a log4j appender that helps in "batching up" messages before logging into the file

2010-02-26 Thread Michael Erskine
Check out org.apache.log4j.FileAppender.setBufferedIO(boolean) Regards, Michael Erskine. - To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org For additional commands, e-mail: log4j-user-h...@logging.apache.org

Re: Creating a log4j appender that helps in "batching up" messages before logging into the file

2010-02-26 Thread Michael Erskine
mon thread. [*] not the LoggingEvent itself - it has excess baggage! I recommend the book Java Performance Tuning by Jack Shirazi published by O'Reilly. Not just for Java performance geeks but for ALL Java developers! And ALWAYS read the code of any librari

Re: Unable to disable ConsoleAppender in Log4j - Plz Help

2010-02-25 Thread Michael Erskine
>From the looks of it I suspect you're made a call to BasicConfigurator.configure() Regards, Michael Erskine. On 25 February 2010 16:26, ragz_82 wrote: > > I am writing logs for my application using Log4j and I need to use only > FileAppender. Right since the beginning, th

Re: Measuring logging performance impact (including string concatenation)

2010-02-23 Thread Michael Erskine
If you're concerned about performance then just code sensibly: when a call is going to be expensive just do what's right and check the logger level. Who cares if it involves an extra if statement? Regards, Michael Erskine. --

Re: How to roll the file based on size and time?

2010-02-19 Thread Michael Erskine
nt of data stored in each file like the RollingFileAppender maxFileSize property or an of the other complexities. I shudder to think of the comprehensive unit test suite to thoroughly validate and verify a unified DailyRollingFile/RollingF

RE: Using SocketAppender in Websphere

2010-02-02 Thread Michael Erskine
GMT] 000f SystemErr R > java.net.ConnectException: Connection refused: connect Sorry, but I have to ask: is there a suitable socket server listening on port 4445 of localhost? Unless you have a permanent logging server I suggest you use a SocketHubAp

RE: DailyRollingFileAppender

2009-12-09 Thread Michael Erskine
text log or write a custom appender that is a "prepender" with an ajax servlet if I wanted to get fancy web output. Regards, Michael Erskine. - To unsubscribe, e-mail: log4j-user-unsubscr...@logging

RE: NDC "Memory Leak" without directly referencing it

2009-11-06 Thread Michael Erskine
Sounds like the contextual information isn't being popped off the stack - ensure your EJBs are being properly finalised and destroyed. Regards, Michael Erskine. - To unsubscribe, e-mail: log4j-user-uns

RE: Is DailyRollingFileAppender efficient or safe to use if log file is huge?

2009-11-03 Thread Michael Erskine
I suggest you create a custom rolling file appender to do exactly what you need. Regards, Michael Erskine. - To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org For additional commands, e-mail: log4j-user-h

RE: JDBCAppender

2009-10-02 Thread Michael Erskine
placed? Hi Kay, People usually roll their own replacement JDBCAppender: it's a lot of hassle trying to create a one-size-fits-all database appender as everybody's requirements are different (I know because I've tried and failed :

RE: How can I write a custom appender to supports Throwable as a second parameter?

2009-09-29 Thread Michael Erskine
pender (NB: costly to collect) call LoggingEvent.getThrowableStrRep() and handle it however you like. Regards, Michael Erskine. > -Original Message- > From: Alexander Spitzer [mailto:aspit...@gmail.com] > Sent: 28 September 2009 20:58 > To: Log4J Users List > Subject: Re:

RE: How can I write a custom appender to supports Throwable as a second parameter?

2009-09-28 Thread Michael Erskine
overridable method for "Throwable" as the second parameter, and so my > method for: > > protected void append(LoggingEvent event, Throwable exin) > > just gets ignored. Alex, You're confusing Appender methods with Logger methods! Regards, Michael Erskine.

RE: Verifying initialization

2009-09-14 Thread Michael Erskine
d out after 30 days of uptime that there's no audit trail! Regards, Michael Erskine. - To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org For additional commands, e-mail: log4j-user-h...@logging.apache.org

RE: Verifying initialization

2009-09-11 Thread Michael Erskine
le in the Appender class for a short while. Logging is pretty important for the work I do so it's all about well-tested graceful failure and fallback. Regards, Michael Erskine. - To unsubscribe, e-mail: log4j-

RE: log4j does not log when the application crashes for some reason

2009-06-30 Thread Michael Erskine
se on this. > > Thanks, > Krishna Forgive me for being glib but the answer is to fix your code :) Regards, Michael Erskine.

RE: Looking for an extended Daily Rolling File Appender

2009-06-02 Thread Michael Erskine
Why not use grep and cron? (There seems to be an endless movement to try and make Log4j perform the tasks already performed perfectly by established tools!) Regards, Michael Erskine. - To unsubscribe, e-mail: log4j-user

RE: Dynamic File Name and Turn off File Logging

2009-05-20 Thread Michael Erskine
> This works fine in Windows > but when run on Unix it actually creates a file called "nul". That's because what you're doing is Windows specific. Fix that if you need a cross-platform configuration.

RE: Warning in Javadoc of JDBCAppender

2009-05-01 Thread Michael Erskine
sure those familiar with the shortcomings of JDBCAppender just write their own custom appender - it's not too difficult and you get just what you need. I would release my source code if my work contract allowed it. I can outline details if anyone wants them.

RE: Serialize Unserialise LoggingEvent..

2009-03-19 Thread Michael Erskine
he source of org.apache.log4j.net.SocketHubAppender for a good example of management of the stream with the appropriate flush and reset methods. Regards, Michael Erskine. - To unsubscribe, e-mail: log4j-user-unsubscr...@loggin

RE: Is re-start of the server required for activation of the log4j settings?

2009-02-02 Thread Michael Erskine
mail the list if all else fails (some choose to do this as their first step :) ) Regards, Michael Erskine. - To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org For additional commands, e-mail: log4j-user-h...@logging.apache.org

RE: Logging messages directed to stdout

2009-01-16 Thread Michael Erskine
n every week - it isn't hard to redirect stdout and stderr and any programmer should able to do it. Regards, Michael Erskine. - To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org For additional commands, e-m

RE: Writing to Database

2009-01-09 Thread Michael Erskine
** Background thread to process async queue */ private Thread bg_thread; /** Set when shutdown */ private boolean shutdown = false; /** * A logged event that is queued for writing to the logging database in a * background thread. * * @author Michael Erskine

RE: I need to make logging in a complete application

2009-01-07 Thread Michael Erskine
int len) throws IOException { // log here in threadsafe manner } } Enjoy! Michael Erskine. - To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org For additional commands, e-mail: log4j-user-h...@logging.apache.org

RE: DatePattern question

2008-09-19 Thread Michael Erskine
g/apache/log4j/DailyRollingFileAppender.html#setDatePattern(java.lang.String) respectively. Enjoy, Michael Erskine. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: no appenders could be found for logger, but I think I have set the classpath!

2008-09-17 Thread Michael Erskine
ot; C:/eclipse/workspace/monitor/monitorClient/src/config/log4j.xml" to point log4j straight at your config. Regards, Michael Erskine. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: log4j files and parsing and presentation

2008-09-17 Thread Michael Erskine
awk, and bash. Of course some tools need getting used to before becoming the most useful :) . Regards, Michael Erskine. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: DatePattern question

2008-09-17 Thread Michael Erskine
> how do I set and get DatePattern attribute from a > DailyRollingFileAppender, in code? Hi Reza, I don't want to sound "all RTFM" :) but the DailyRollingFileAppender has methods getDatePattern and setDatePattern! Perhaps a glance at the code? :) Reg

RE: static log4j configuration statement

2008-09-11 Thread Michael Erskine
g4j configuration created if one has not already been configured explicitly (or, perhaps, automagically). Regards, Michael Erskine. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: static log4j configuration statement

2008-09-10 Thread Michael Erskine
eCheck.check(); } ...and here follows a version of the class suitable for redistribution. Enjoy, Michael Erskine import org.apache.log4j.ConsoleAppender; import org.apache.log4j.Logger; import org.apache.log4j.PatternLayout; /** * Occasionally we find a JUnit test suite or test case clas

RE: network logging performance

2008-09-04 Thread Michael Erskine
erfacing. I have a strong belief that any non-trivial networked communications system can be generalised to IRC! Just my 2 euros :) Regards, Michael Erskine. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: HOw to replace the system.out.println

2008-09-02 Thread Michael Erskine
cious buffering and filtering of course!) Regards, Michael Erskine. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: Can custom appender override the log4j.xml configuration

2008-08-22 Thread Michael Erskine
hilst I use this technique extensively, I was quoting from the Introduction to log4j... http://logging.apache.org/log4j/1.2/manual.html I suggest you read it and if you want more detail feel free to read the source. If you still can't solve your problem feel free to ask for more help. Regards, M

RE: Can custom appender override the log4j.xml configuration

2008-08-19 Thread Michael Erskine
Or does the > log4j.xml > configuration overrides the settings in the class files ?? If you don't want log4j to avoid the default initialization procedure you can set the log4j.defaultInitOverrride system property to anything other than "false". Regards, Michael Erskine. --

RE: Distributed Logging Problem (log to remote database possible?)

2008-08-08 Thread Michael Erskine
thing up to connect to many servers, keep the connections up, render the logged events, queue them for writing to the databases, write to the databases asynchronously with DB connection pooling and recovery, etc., etc. Lots of scope for fun here! Regards, Michael Erskine. -

RE: Circular Dependency through Appender

2008-07-17 Thread Michael Erskine
7;t rely on any particular logging framework at runtime - keep it optional. Regards, Michael Erskine. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: JDBCAppender configuration

2008-07-15 Thread Michael Erskine
pretty simple stuff -- I learned most of how Log4J works by stepping through the source in Eclipse. Regards, Michael Erskine. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: JDBCAppender configuration

2008-07-15 Thread Michael Erskine
ConsoleAppender to debug what your app is doing and set a threshold of INFO on your JDBCAppender. The JDBCAppender is shoddy anyhow - write yourself a replacement. It's a great way to learn about what makes a good Appender. Regards, Michael Erskine. ---

RE: How to use a RollingFileAppender asynchronously?

2008-07-11 Thread Michael Erskine
bly crafted JDBC appender (I'll publish it one day!) Regards, Michael Erskine. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: precision of log4j

2008-06-24 Thread Michael Erskine
timing... long t1 = System.nanoTime(); function_n(); long t2 = System.nanoTime(); logger.debug("duration in nanos: "+(t2 -t1)); Regards, Michael Erskine. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: Log4J uncaught exception

2008-05-22 Thread Michael Erskine
in their package names. Here's the author's page... http://www.dankomannhaupt.de/projects/index.html ...I looked into using this JDBC appender but after reading some of the source I decided to write my own. Regards, Michael Erskine.

RE: Simple log4j setup 1) to System.out.println (or eclipse console) or 2) file and 3) enableable at runtime + without need for log4j.xml ?

2008-04-30 Thread Michael Erskine
me and is included in my eclipse JUnit templates. > Is there a log4j class that I can call methods on directly to set up the > above three things? Logger.getRootLogger() is your starting point. Then you can configure individual Appender instances to

RE: Everybody's logging but me

2008-03-13 Thread Michael Erskine
my main class (System.setProperty("log4j.defaultInitOverride", "true");). Then I am free to programmatically configure log4j just so. It follows, however, that if any of your libraries do something similar then

RE: Different levels to different appenders

2008-02-27 Thread Michael Erskine
Personally, I'd just log everything to a single file and filter it with a simple Perl script either after the fact or in a POE file tail app. Just my two cents - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands,

RE: Handling Logging Events Directly

2008-02-12 Thread Michael Erskine
Stream(s.getInputStream()); while (true) { LoggingEvent event = (LoggingEvent) ois.readObject(); log.debug("remote event:'" + event.getMessage() + "'"); } You can get fancy with it and have the "receiver" app do whatever you like with the messages

RE: expiry of DailyRollingFileAppender old logs

2007-12-10 Thread Michael Erskine
Whoops! > long now = System.currentTimeMillis(); > File[] files = getExpiredLogfiles(fileNameRoot, datePattern, null, > new Date(now + maxage)); That Date should be new Date(now - maxAge) since maxAge is defined as... private static long maxage = 7 * DateUtils

RE: expiry of DailyRollingFileAppender old logs

2007-12-10 Thread Michael Erskine
> From: dirk ooms [mailto:[EMAIL PROTECTED] 10 December 2007 10:53 > your script could just look at the 'last edit' time of the file, without > having to look at the name of the file. That's a good idea Dirk but I'd prefer to stick to the spec (since that's what the customer's acceptance tests wi

expiry of DailyRollingFileAppender old logs

2007-12-10 Thread Michael Erskine
f this has been done elsewhere (probably better!). Kind Regards Michael Erskine - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]