Re: Logging messages directed to stdout

2009-01-16 Thread Matthew Kemp
On Fri, Jan 16, 2009 at 9:17 AM, Jay wrote: > Hi Matt > > Went through the archive for last two months. I couldn't find any related > threads to this topic. Could you forward me the details of the thread, that > you were referring, please ? > > TIA > > --- On Fri, 1/16/

Re: Logging messages directed to stdout

2009-01-16 Thread Matthew Kemp
There was an example of this a couple weeks ago on the mailing list. The recommended solution then was to set System.out and System.err to a new PrintStream that you control. Then you read lines from the PrintStream and log messages using log4j. Matt On Jan 16, 2009, at 8:41 AM, Jay wro

Re: AsyncAppender "blocking" property

2008-06-26 Thread Matthew Kemp
There's no property on the AsyncAppender that I know of called 'blocking'. What are yout trying to accomplish with this property? On Thu, Jun 26, 2008 at 3:32 PM, Adam Mitchell <[EMAIL PROTECTED]> wrote: > I'm trying to disable blocking in the AsyncAppender, but get this message > on > init: > >

Re: FileAppender Truncates Stack Trace

2008-04-23 Thread Matthew Kemp
You can create your own custom object renderer that will properly render the whole stack trace. This renderer will need to be included in the log4j config and be available on the classpath when log4j initializes. On Wed, Apr 23, 2008 at 3:19 PM, Robert Pepersack < [EMAIL PROTECTED]> wrote: > Hel

Re: how to change the %m in PatternLayout

2008-04-08 Thread Matthew Kemp
You could create your own Layout class. While you loose some of the flexibility of the PatternLayout class you can perform any message formatting/encoding. The Layout class takes a LogEvent and returns the formatted string. It might also be possible to extend the PatternLayout. Matt On Tue, Apr

Re: log4j Guidelines

2008-02-21 Thread Matthew Kemp
Try moving your 'ASYNC' appender definition after all the other appender definitions. This might be causing your error as none of the other appenders have been created yet. Also as a side note, I'd recommend using instead of . Matt 2008/2/21 Cosette Kamakian <[EMAIL PROTECTED]>: > The proble

Re: changing logger log levels while application is running

2007-12-13 Thread Matthew Kemp
> > > > > > > > > > > > > >

Re: changing logger log levels while application is running

2007-12-12 Thread Matthew Kemp
To expand on Orko's comment, the code to do this would look something like: // to get a logger level as a string public String getLoggerLevel(String loggerName) { return Logger.getLogger(loggerName).getLevel().toString(); } // to set a logger level as a string public void setLoggerLevel(String

Re: Setting Header for DailyRollingFileAppender

2007-11-16 Thread Matthew Kemp
You need to extend one of the layout classes and add in getters and setters. The header and footer in Layout only return null - indicating no header/footer. On Nov 15, 2007 7:43 PM, Satish Musunuru <[EMAIL PROTECTED]> wrote: > Hi, > How can I set the header for DailyRollingFileAppender > progra

Re: where can i see the log.Debug("somemessage") ???? message

2007-11-14 Thread Matthew Kemp
Can you also post your log4j properties file? My guess is that the log levels are not correct or that appenders are not attached appropriately. Matt On Nov 14, 2007 2:22 AM, msg2ajay <[EMAIL PROTECTED]> wrote: > > hi friends, > I am new to log4j . i have written > [CODE] > > - lo

Re: Forcing XML configuration file to reset Log4J configuration

2007-11-13 Thread Matthew Kemp
To reset an entire configuration you need something like this: public void reloadLog4J() { LogManager.resetConfiguration(); DOMConfigurator.configure("log4j.xml"); } Unfortunately, even the DOMConfigurator.configureAndWatch() only does an incremental reload. Matt On Nov 13, 2007 3:58

Re: Log4j for Multiple classes

2007-11-13 Thread Matthew Kemp
Loggers can be named anything you want them to be. Traditionally they're named after the class to aid with debugging, etc. You don't have to specifically create a logger for each class. If at the top of every class you had a line like - private static final Logger logger = Logger.getLogger("foo");

Copying MDC values for multithreaded apps

2007-11-12 Thread Matthew Kemp
I'm working on an app where we have a decorator Log4JRunnable class that used to wrap runnables submitted to a thread pool. It retrieves a copy of the MDC from the submitting thread (code included below). The problem that I am running into is that occasionally a ConcurrentModificationException is b

Re: Trouble Referencing An XML Config File

2007-11-08 Thread Matthew Kemp
PropertyConfigurator only reads property files. To read an xml config you need to use the DOMConfigurator. Another option would allow log4j to statically initialize itself (your config file needs to be on the class path). On Nov 8, 2007 4:30 PM, <[EMAIL PROTECTED]> wrote: > Here's my log4j-specif

Re: Production configuration

2007-11-07 Thread Matthew Kemp
Did you try setting the level of the root logger/all loggers to OFF? On Nov 7, 2007 8:03 AM, Phillip Mills <[EMAIL PROTECTED]> wrote: > For performance reasons, I would like to disable log4j logging entirely in > a > Java EE application, but I haven't stumbled on the magic formula yet. > > I've t

Re: log4j file name and line number

2007-10-25 Thread Matthew Kemp
I'm not a 100% for sure about how log4j gets the class info, but I believe it retrieves the previous value from the stack. So if your class/method that was performing logging was Foo/foo, normally the stack would look something like: Logger.log(xx) Foo.foo(xx) ... However with your intermediary

Re: java.util.logging and log4j on same application

2007-10-23 Thread Matthew Kemp
I'm not super familiar with the java.util.logging but java.util.logging.Handler is roughly equivalent to org.apache.log4j.Appender. One option would be to create a custom Handler that repackages the java.util.logging.LogRecord as a org.apache.log4j.LoggingEvent. This seems like something that would

Re: How to disable the struts logging?

2007-10-17 Thread Matthew Kemp
If you want to make struts not log info messages use: log4j.logger.org.apache.struts=WARN, stdout If you want to disable struts logging entirely use: log4j.logger.org.apache.struts=OFF, stdout On 10/17/07, Pamarthi, Ramakrishna <[EMAIL PROTECTED]> wrote: > > Hi, > > My application logging the

Re: Suppressing passwords in the log files?

2007-10-15 Thread Matthew Kemp
Where are you pulling the passwords from? Are you using an NDC/MDC? If the passwords are logging directly by your application - i.e. something like: logger.debug("password = " + password); Then you should look at changing the log statements. On 10/15/07, John Smith <[EMAIL PROTECTED]> wrote: >

Re: method level logger, possible?

2007-10-11 Thread Matthew Kemp
gt; for %5p [%c] [%C.%M] (%F:%L) - %m%n format: > > > > ERROR [test.first.Another] [test.first.Another.main] (Another.java: > > 19) - error message > > ERROR [test.first.Another] [test.first.Another.testAMethod] > > (Another.java:34) - another error Msg > > > &

Re: method level logger, possible?

2007-10-11 Thread Matthew Kemp
%C.%M] (%F:%L) - %m%n format: > > ERROR [test.first.Another] [test.first.Another.main] (Another.java:19) - > error message > ERROR [test.first.Another] [test.first.Another.testAMethod] (Another.java:34) > - another error Msg > > Matthew Kemp <[EMAIL PROTECTED]> wrote: One solution (although

Re: method level logger, possible?

2007-10-11 Thread Matthew Kemp
One solution (although I'm not sure about the performance impacts) would be to create loggers that are children of the class logger. For example if you had a class 'Bar' in package 'foo', the your logger for the class would be ' foo.Bar'. If Bar has a method bar() and baz() you could create a logge

Re: Log4j with glassfish

2007-09-07 Thread Matthew Kemp
Can you clarify your setup? Do you mean that all three are deployed in the same container/VM? Or they're in three different containers/VM's but they're all going to the same log file. Also is there one log4j config or three seperate ones? On 9/7/07, Drinkwater, GJ (Glen) <[EMAIL PROTECTED]> wrote:

Re: Pretty Layout of logging by class & method

2007-08-31 Thread Matthew Kemp
Are you saying that you want one logger.log() call to print the entire stack trace? Or do you want logger.log() calls exiting and entering each method? On 8/31/07, Faine, Mark R. (MSFC-NNM04AA02C)[SAIC] <[EMAIL PROTECTED]> wrote: > > > I'd like for Log4J to print the log messages with some sort of

Re: Problem with File appender

2007-08-30 Thread Matthew Kemp
You still need to attach the appender to a logger. Try adding this line to you log4j properties file: log4j.rootLogger=info, file On 8/30/07, Siamak Sarmady <[EMAIL PROTECTED]> wrote: > > Hello, > > I have a simple log4j program. > > When I use the "stdout log messages" section of my log4j.proper

Re: xml or properties

2007-08-29 Thread Matthew Kemp
There is some overhead with parsing the xml/building the DOM, but since that only happens when the config is loaded the impact should be minimal. Once log4j is setup there is no difference. On 8/29/07, simon litwan <[EMAIL PROTECTED]> wrote: > > hi all > > is there any difference re performance wh

Re: Appenders writing log file when not called apon

2007-08-29 Thread Matthew Kemp
I think it would be useful to implement your solution as a configurable parameter of an FileAppender. By default this delayFileCreation parameter would be false so log4j performs the same as now. However you could set the delayFileCreation parameter to true to cause the FileAppender to wait until i

Re: get off list

2007-08-15 Thread Matthew Kemp
--- Administrative commands for the log4j-user list --- I can handle administrative requests automatically. Please do not send them to the list address! Instead, send your message to the correct command address: To subscribe to the list, send a message to: <[EMAIL PROTECTED]> To remove your ad

Re: How to stop further processing?

2007-08-03 Thread Matthew Kemp
Setting additivity to false should fix your problem. I'm not sure about the properties log4j config, but in log4j.xml it's just an attribute on the logger. On 8/3/07, Daniel Henninger <[EMAIL PROTECTED]> wrote: > > Hi folk! > > I'm trying to switch my project to log4j and am running into an issue

Re: Using multiple config files with log4j

2007-07-20 Thread Matthew Kemp
Thanks for your response. First, I didn't realize that the XML include mechanism worked with log4j yet. I will give that a try and see if I can get it working. Do you know if it should work with version 1.2.9 - I know the current version is 1.2.14 but I'm stuck with the older version right now. A

Using multiple config files with log4j

2007-07-19 Thread Matthew Kemp
going to be a major roll-your-own project? Thanks, Matthew Kemp