RE: [SCL-3] using of system properties in subject of SMTPAppender

2011-05-24 Thread Bender Heri
Usually a customer is served within one separate thread, isn't it? If yes, you can use the MDC (mapped diagnostic context). You put a value into it: MDC.put("CUSTOMER", "SOME NAME") at the begin of the session (probably in a servlet listener) and reference this value with the layout pattern %X

RE: is it possible to have different log level for same package

2011-05-23 Thread Bender Heri
I am not sure about properties configuration. But with xml configuration I would do: - define one logger (your package name, level debug) - assign two appenders to this logger: - appender1: with level range filter error and higher - appender2: without level range filter Heri > -Orig

RE: [SCL-4] Intercepting LoggingEvent

2010-11-29 Thread Bender Heri
Depends on the implementation of your renderer. The renderer is called only after log4j framework has decided that a logoutput will really occur, means that all checks on log levels of logger and appenders are already executed. Heri > -Original Message- > From: Mohan.Radhakrishnan [mailt

RE: [SCL-4] Intercepting LoggingEvent

2010-11-25 Thread Bender Heri
Write your own Renderer derivation which you can specify in xml configuration (assign to your specific class, see below). The Trick is that you pass a custom object to the log calls (the param need not to be a String, it is formally an object): MySpecificLogInfoHolder infos = new MySpecific

RE: Help understanding Log4j basics

2010-11-25 Thread Bender Heri
> I've previously searched the manual and I understand the hierarchy of: > DEBUG < INFO < WARN < ERROR < FATAL > However, I'm interested in in learning if there is a way to print ONLY > one level rather than the target level and all levels above it. Unless > I've missed it, the manual does not expl

RE: Extending Logger

2010-11-02 Thread Bender Heri
I don't know. You have to try if the log4j.xml can be omitted. Heri > -Original Message- > From: Mohan.Radhakrishnan [mailto:moh...@fss.co.in] > Sent: Tuesday, November 02, 2010 2:39 PM > To: log4j-user@logging.apache.org > Subject: RE: Extending Logger > > > Yes. I am responding to you

RE: Extending Logger

2010-11-02 Thread Bender Heri
I am confused. Do you respond to my suggestion? I suggested to set up everything Logger and Appender) programmatically, as it is defined in your own config file. Which performance do you mean? The setup performance or the runtime, when the loggers are used? The latter is independantly of how you

RE: Extending Logger

2010-11-02 Thread Bender Heri
If I understand you correctly: You have many instances of your CustomLogger (as many as you want different log files), each wrapping a separate instance of Logger. The name of the file is configured in a file (I assume a pairing of logger names and file names?). My suggestion: Do not extend Logge

RE: Extending Logger

2010-11-02 Thread Bender Heri
What is the reason you want extend the Logger? Heri > -Original Message- > From: Mohan.Radhakrishnan [mailto:moh...@fss.co.in] > Sent: Thursday, October 21, 2010 1:22 PM > To: log4j-user@logging.apache.org > Subject: Extending Logger > > > The complete Log4J manual discourages us from e

RE: [SCL-4] Is it possible to configure different log levels for the same appender based on what logger it is coming from?

2010-10-21 Thread Bender Heri
One possibility I see: Write an own Filter which is attached to the root logger's Apender and filter out the messages which you do not want. Heri > -Original Message- > From: Adam Creeger [mailto:adamcree...@gmail.com] > Sent: Wednesday, October 20, 2010 11:23 PM > To: log4j-user@logging.

RE: Log4j - do only log statements for my application

2010-05-04 Thread Bender Heri
> It's all bundled within my war file - the log4j-1.2.16.jar is located > under WEB-INF/lib, the log4j.properties is under WEB-INF/classes. > > What I don't understand is why my application affects the logging of > some other apps on the application server. > > -

RE: Log4j - do only log statements for my application

2010-05-04 Thread Bender Heri
What application server? Where is the properties file and the log4j.jar located? Heri > -Original Message- > From: Huber, Stephan [mailto:stephan.hu...@gigatronik.com] > Sent: Tuesday, May 04, 2010 2:33 PM > To: log4j-user@logging.apache.org > Subject: Log4j - do only log statements for my

RE: Problem with linux

2010-04-28 Thread Bender Heri
The IBM lib is overwriting your own log configuration, probably by a active configure() call. Either you do this in your code, or the library does it. In the first case you have search, in the second case you have to ask the IBM library support how to disable the behaviour, or how to configure t

RE: [SCL-3] deploying several log files

2010-04-14 Thread Bender Heri
Below I copied the all XML which I reviewing. http://jakarta.apache.org/log4j/";> Saludos Marco Silva EAI Consultant On Wed, Apr 14, 2010 at 11:48 AM, Bender Heri wrote: > Add the attrib

RE: [SCL-3] deploying several log files

2010-04-14 Thread Bender Heri
Add the attribute additivity="false" to your specialized loggers in order to not have the log output in the root logger: Heri -Original Message- From: Marco Silva [mailto:mlsil...@gmail.com] Sent: Wednesday, April 14, 2010 11:15 AM To: log4j-user@logging.apa

RE: [SCL-2] Re: Multiple log files, multiple logger names and the same appender

2010-04-08 Thread Bender Heri
If I understand you correctly, you want to have several loggers all using the same appender? Use the hierarchical approach of the logger repository by prefixing your logger names:

AW: AW: Path exclusion for logs

2010-03-18 Thread Bender Heri
rent class(AbstractHttpClient) instantiates the log like this: private final Log log = LogFactory.getLog(getClass()); Also turns out that this is a commons.logging logger and not a log4j as i thought Also it looks like it's private so i can't override it, any ideas? Bender Heri wrote: > >

AW: Path exclusion for logs

2010-03-18 Thread Bender Heri
Probably the parent class does not instantiate his logger statically but like this: Logger logger = Logger.getLogger( this.getClass().getName() ); and therefore it retrieves a logger with the name of your descendant (name starting with your namespace). If it would instantiate it statically: st

AW: Problems with inheritance of com.foo... loggers

2010-02-04 Thread Bender Heri
There is one point more: You do not define a root logger in your config which has some benefits The root is the parent for all loggers which are not explicitely defined (e.g. also for third party libraries like org.apache). Typically you set the root logger level to WARN. And for the package/

AW: [SCL-4] funny behaviour using filters

2009-11-17 Thread Bender Heri
I cannot see how you configure the LevelRangeFilter. See my example for separating console.out and console.err:

AW: AW: Log4j.xml setting for Hibernate not working

2009-11-16 Thread Bender Heri
/2009 08:11 PM57,250 streambuffer.jar 40 File(s) 16,805,402 bytes 2 Dir(s) 52,573,892,608 bytes free --John Bender Heri wrote: > > Are you sure that your log configuration file is picked up? Maybe > there is annother config file on the c

AW: Log4j.xml setting for Hibernate not working

2009-11-16 Thread Bender Heri
Are you sure that your log configuration file is picked up? Maybe there is annother config file on the class path which is used before yours is found. I have no problems on Tomcat with special hibernate loggers. Heri -Ursprüngliche Nachricht- Von: John2000 [mailto:johnk...@gmail.com] Ges

AW: Using two SMTPAppenders

2009-11-09 Thread Bender Heri
First what I notice is the same int value of your custom levels (both have 6). But: Why that complicated? Why not only define two separate loggers by name, a "SuccessLogger" and a "FailLogger"? The places where one of these loggers are called know about the success or the failure (your solut

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

2009-11-02 Thread Bender Heri
logfiles up to 200 MB didnt throw any problems (on windows XP and winserver2003 with NTFS). Heri -Ursprüngliche Nachricht- Von: shaoxianyang [mailto:ysxsu...@hotmail.com] Gesendet: Montag, 2. November 2009 21:47 An: log4j-user@logging.apache.org Betreff: Is DailyRollingFileAppender effic

AW: convert org.apache.log4j.Logger to org.apache.commons.logging.Log

2009-10-29 Thread Bender Heri
You cannot cast it. But if you instantiate the commons Logger with the same name as your log4j logger your log statements will end up in the same logger instance (log4j Logger). Commons logging is only a wrapper, and instantiates log4j if it finds a log4j.jar in the classpath (and not configured

AW: FileAppender is not assignable to Appender

2009-10-29 Thread Bender Heri
My guess: there are two log4j.jar, probably of different versions: one in the parent classlaoder and one in the child classloader. Therefore java regards these two as different classes. Heri -Ursprüngliche Nachricht- Von: chrisgage [mailto:chrisg...@bellsouth.net] Gesendet: Mittwoch, 28

AW: Logging without logging to the root logger

2009-10-21 Thread Bender Heri
-Ursprüngliche Nachricht- Von: Ofer Kalisky [mailto:kali...@hotmail.com] Gesendet: Mittwoch, 21. Oktober 2009 20:15 An: log4j-user@logging.apache.org Betreff: Logging without logging to the root logger Hi, I have the following con

AW: Log session session information (Web)

2009-09-30 Thread Bender Heri
Of course. MDC content is kept on a per thread basis. Since each session is handled in its own thread, you can put a value into the MDC somewhere at the entry point of a session (and remove it again when session is finished). The formatter of log4j (at least the PatternLayout) can retrieve this

AW: Configuring log4j with XML

2009-09-30 Thread Bender Heri
First: For simple configuration needs (in fact for most configuration needs) you do not need to call a configurator explicitely. Just put your config file in the classpath, and log4j finds it for you and autoconfigures itself the first time the LogManager is loaded (e.g. on a static Logger.getL

Appender-ref within appender tag

2009-09-29 Thread Bender Heri
Hi all The appender tag of xml configuration allows formally to be like that: According to DTD: But: how to use this feature? I would like to use one ref to this STANDARD_APPENDERS in my logger definitions, since I have a lot of finetuned logger definit

AW: AW: Logging done in the wrong files

2009-09-17 Thread Bender Heri
log4j.properties file , and we are using custom log4j and we have added in a shared variable of WAS, all logs are getting in a WAS logs path with a short names , and also timestamp attached in the logs are wrong, Regards, Yogesh On Thu, Sep 17, 2009 at 12:16 PM, Bender Heri mailto:hben...@ergonomics.ch

AW: AW: Logging done in the wrong files

2009-09-16 Thread Bender Heri
Additivity flag has no effect on root logger since the root logger is the uppermost logger within the hierarchy. The flag is only meant for subordinated loggers (e.g. com.my.company. ...). Do you have two log4j.jar in the same application? Each application needs only one (in WEB-INF/lib), and t

AW: Logging done in the wrong files

2009-09-16 Thread Bender Heri
Brown for the reply. The following was the reply given by Bender Heri Your problem is a classloader issue. Keep in mind that the Logger-Universe which you initialize within your static method is globally the same within the same classloader. Annother classloader would initialize another logge

AW: Events appear incorrect inside the wrong file

2009-08-31 Thread Bender Heri
Maybe the PatternLayout is not threadsafe? Try to instantiate separate instances of PatternLayout for each Logger, or synchronize on the sole instance of PatternLayout. Heri PS: It is not quite clear who calls your log method the log-Event, and how looks the other log method which writes to the

AW: using a different log4j.properties file per classes directory

2009-07-14 Thread Bender Heri
> which then causes all the tabs based logging to occur in a separate file (defined under the T log definition). The log entries from tabs are repeated > into the root logger, which is not ideal but I can deal with. Have a look at the Additive property of logger/category, and set it to false (BTW

AW: DailyRollingFileAppender & RollingFileAppender after a rollover continues to write on previous file...

2009-07-13 Thread Bender Heri
Problems with the rolling over behaviour occur mostly if more than one Appender write to the same file, e.g. out from different JVM's (since the file system cannot rename it if the other Appender still holds a handle on the file). Heri -Ursprüngliche Nachricht- Von: Roberto Simoni [mailt

AW: What causes RollingFileAppender to not roll over

2009-06-29 Thread Bender Heri
A common reason for not rolling over is that more than one appender instance write to the same file, i.e. more than one file handle are open on the same physical file. Heri -Ursprüngliche Nachricht- Von: DOUTCH GARETH-GDO003 [mailto:gareth.dou...@motorola.com] Gesendet: Montag, 29. Jun

AW: turn off log messages in rootLogger which are supposed to end up in a named logger

2009-06-25 Thread Bender Heri
Something like log4j.logger.PhasesLogger.additivity=false I am not quite sure about the correct syntax in properties file (I work always with xml files). The additivity flag of a logger prevents the loggin event to climb up further the logger hierarchy. Heri -Ursprüngliche Nachricht- Vo

AW: - Log4j File appenders-generate files specified by appenders only in first usage

2009-06-24 Thread Bender Heri
You cannot do this by configuration. What is the problem of having empty log files? Heri -Ursprüngliche Nachricht- Von: inosh [mailto:inosh...@gmail.com] Gesendet: Mittwoch, 24. Juni 2009 10:59 An: log4j-user@logging.apache.org Betreff: [SPAM (Keyword Checking)] - Log4j File appenders-gen

AW: Log4j : Read String from file

2009-06-22 Thread Bender Heri
If "fixed string" means the string stays the same throughout the lifetime of the running application you can use the MDC. You add your string into the MDC at startup and reference its key within the layout pattern ("X{}"). Heri -Ursprüngliche Nachricht- Von: durbans [mailto:m34890...@yah

AW: [SPAM (Bayesain Analysis)] - Re: concurrency issues with one log file for multiple - Bayesian Filter detected spam

2009-06-22 Thread Bender Heri
Be sure that all your Loggers use the same file appender (only once configured). The behaviour of several file appender instances writing to the same file (in different threads) is undefined and should be avoided. Heri -Ursprüngliche Nachricht- Von: Yair Ogen [mailto:yairo...@gmail.com]

AW: Access logfile logger

2009-05-04 Thread Bender Heri
You cannot get access to the file object itself for reading purpose because the FileAppender uses a FileWriter class for writing to the file. But you can learn the file name where the appender writes to. Not each logger instance which you get by Logger.getLogger() has appenders attached. Only th

AW: [SPAM (Bayesain Analysis)] - Log file per thread - Bayesian Filter detected spam

2009-05-04 Thread Bender Heri
Log4j distinguishes between Loggers and Appenders for a good reason: - Loggers define WHAT is logged (level, source) - Appenders define WHERE the log statement goes (console, file, etc.) and how it is formatted You want to have a new file for each new thread, so this is an appender issue whic

AW: logging from another class

2009-04-15 Thread Bender Heri
Hi In one of my projects I have implemented a swing TextPane Appender. See below the two classes JTextPaneAppender and JLogoutputFrame. The first one was copied (and enhanced) from a sample I found in the contribs package (but which did not work properly). The second one is a standalone window

AW: Newbie questions

2009-04-09 Thread Bender Heri
If you do not specify any appender, your log message will go nowhere. Please read first the basics about log4j, before asking such dumb questions. Search the web for "log4j tutorial" and you will find tons of instructions and examples. Heri -Ursprüngliche Nachricht- Von: John El [mail

AW: Configure custom logger from file

2009-04-02 Thread Bender Heri
Already looked at the LoggerFactory? Heri -Ursprüngliche Nachricht- Von: Yair Ogen [mailto:yairo...@gmail.com] Gesendet: Donnerstag, 2. April 2009 10:13 An: log4j-user@logging.apache.org Betreff: Configure custom logger from file Hi, I need to configure a custom Legger that extends the

AW: [SPAM (Bayesain Analysis)] - 'DailyRollingFileAppender' problem - two process, one log4j.properties file - Bayesian Filter detected spam

2009-03-16 Thread Bender Heri
Two JVM logging to the same file is a "MUST NOT". Heri -Ursprüngliche Nachricht- Von: yokese [mailto:fastturtle...@gmail.com] Gesendet: Montag, 16. März 2009 13:35 An: log4j-user@logging.apache.org Betreff: [SPAM (Bayesain Analysis)] - 'DailyRollingFileAppender' problem - two process, o

AW: [SPAM (Bayesain Analysis)] - Using log4j.properties to handle other properties - Bayesian Filter detected spam

2009-03-09 Thread Bender Heri
I assume you mean following (pseudo code) If SystempropertyCollectStatistics==True myLog.info( ... ) The correct way would be to use a special named logger and declare it in the propeties file with the desired log level. Possible code in class with statstic logging needs: Logger myNormalD

AW: How to filter the unnecessary log messages

2009-03-09 Thread Bender Heri
Either you strongly restrict the level of your root logger (e.g. ERROR) and declare a logger for your own classes with DEBUG level: (appender-refs) (appender-refs) Or you go the other way round, you restrict the library loggers stro

AW: Logging issue with logginf to seperate log files

2009-02-25 Thread Bender Heri
The config file seems to be OK (BTW: You should use the tag "logger" instead of "category" which is deprecated). How do you fetch the logger instance in LoadCommonData? You should use "Logger.getLogger( LoadCommonData.class )". For debugging log4j, add the attribute debug to the root tag: http:/

AW: sending output from separate java packages to separate files

2009-02-16 Thread Bender Heri
Additivity in Properties file: Log4j.additivity.=false See also page 53 in Manual. Heri -Ursprüngliche Nachricht- Von: Pat Farrell [mailto:pfarr...@pfarrell.com] Gesendet: Dienstag, 17. Februar 2009 06:32 An: Log4J Users List Betreff: [SPAM (Bayesain Analysis)] - Re: sending output fr

AW: Log Debug and Info in 2 different files

2009-02-16 Thread Bender Heri
What is the problem? The below configuration seems OK, if you replace the "..." by the other needed parameters (file, layout, etc). You can put debug="true" to see on the console how log4j configures itself. Heri -Ursprüngliche Nachricht- Von: Steve Cohen [mailto:sco...@javactivity.org]

AW: Log Debug and Info in 2 different files

2009-02-16 Thread Bender Heri
I think it is not necessary to use Filters as Curt suggested since you dont want to have an upper limit of the levels. Add the threshold property to the appender declaration. Your problem is that you have defined two loggers with the same name. I assume that the second one overwrites the first

AW: difference between using properties file and XML file to loading log4j preferences

2009-02-10 Thread Bender Heri
XML is the newer technology. Property files are not guaranteed to be supported for all upcoming features. E.g. in XML you can use Filter in appender definitions which you can't use in Property files. Heri -Ursprüngliche Nachricht- Von: Ashish Kulkarni [mailto:ashish.kulkarn...@gmail.com]

AW: Load a log4j.xml located within a package - how?

2009-02-10 Thread Bender Heri
Maybe there exists indeed a file "C:\Programme\Mozilla Firefox\de\xyz\...\log4j.xml" which is found first by the classloader? Then try getResources() to get an enumeration of all resources found. Or try getSystemResource() of the classloader. Heri -Ursprüngliche Nachricht- Von: Linnemann

AW: which mail that I can send my questions to?

2009-02-10 Thread Bender Heri
This is the correct list for questions about using log4j. Heri -Ursprüngliche Nachricht- Von: 刘永辉 [mailto:yh...@cn.ufinity.com] Gesendet: Dienstag, 10. Februar 2009 06:19 An: log4j-user Betreff: [SPAM (Bayesain Analysis)] - which mail that I can send my questions to? - Bayesian Filter d

AW: log4j help: disabling org.apache.commons.digester.Digester logs

2009-01-26 Thread Bender Heri
In your log4j Config, define a subordinated Logger with a higher log level, e.g. INFO: To have the log statements of this class only logged at level INFO or higher Or To have the log statements of the whole package org.apache.commons log

AW: Redirect system.out into FileAppende

2009-01-08 Thread Bender Heri
I suggest to implement a specialized OutputStream which writes to the file appender (or directly to the file appender's file, if no threading issue arise). Then replace the default System.out and System.err streams by this specialized stream. Heri -Ursprüngliche Nachricht- Von: thomas.t

AW: [SPAM (Bayesain Analysis)] - I need to make logging in a complete application - Bayesian Filter detected spam

2009-01-05 Thread Bender Heri
I am not quite shure what you want to do. Do you want to leave all System.out.println calls in your code? If so, you do not need log4j to redirect them. Just redirect the System.out Outputstream to a stream of your like. If you want to use log4j, you have to replace all System.out calls with the

AW: [SPAM (Keyword Checking)] - RE: SMTPAppender - Found word(s) list error in the Text body

2008-12-04 Thread Bender Heri
to remote host: Connection timed out But I have a stupid question, using telnet my client is expected to find a telnet server on the port 25, while there should be an smtp server. Am I wrong? /MAx -Original Message- From: Bender Heri [mailto:[EMAIL PROTECTED] Sent: giovedì 4 dicembre

AW: SMTPAppender

2008-12-04 Thread Bender Heri
Try a standalone tool in order to open this socket. E.g. castalia socktest (free download), or even telnet in your command prompt: Telnet host port heri -Ursprüngliche Nachricht- Von: Massimo Quagliani [mailto:[EMAIL PROTECTED] Gesendet: Donnerstag, 4. Dezember 2008 18:02 An: Log4J Us

AW: [SPAM (Bayesain Analysis)] - Repository selectors, useful? - Bayesian Filter detected spam

2008-11-26 Thread Bender Heri
Hallo Ceki I found log4j's RepositorySelector very useful, I think I would not have been able to solved my problem without it. I use it in a System which is designed to maintain different customers. A single customer should never see any data (or even know about the existence) of other custome

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

2008-09-17 Thread Bender Heri
You should only define the path and not also the file: CLASSPATH=%CLASSPATH%;C:\eclipse\workspace\monitor\monitorClient\src\config Instead of CLASSPATH=%CLASSPATH%;C:\eclipse\workspace\monitor\monitorClient\src\config\log4j.xml -Ursprüngliche Nachricht- Von: raybristol [mailto:[EMAI

RE: [SPAM (Bayesain Analysis)] - RE: static log4j configuration statement - Bayesian Filter detected spam

2008-09-11 Thread Bender Heri
Just put your property file into the classpath and you do not have to worry about initialization of log4j framework. It does it automagically when you fetch the first logger. Heri > -Original Message- > From: Michael Erskine [mailto:[EMAIL PROTECTED] > Sent: Wednesday, September 10, 2008

RE: Logger object and change filename

2008-09-11 Thread Bender Heri
name... > >> > >> So for each element, I need a brand new logger with > appenders exactly > >> the same as the one defined in log4j.xml file, the only > difference is > >> the filename for the appender, there is only one. > >> > >> Does thi

RE: [SPAM (Bayesain Analysis)] - Logger object and change filename - Bayesian Filter detected spam

2008-09-09 Thread Bender Heri
Loggers do not have file names attached. Probably you mean a FileAppender. Each configured Appender is instantiated as singleton, even if it is attached to more than one Logger. Loggers are identified by a arbitrary String, commonly the FQCN. Therefore you cant clone a Logger which has the same n

Re: How to get values from log4j.xml file

2008-08-26 Thread Bender Heri
structor, I have > Appender serverAppender = log.getAppender(""XXX_LOG_FILE"); > if (serverAppender != null) > { > String name = serverAppender.getName(); > } > > serverAppender is always null. > > Any thoughts on

RE: How to get values from log4j.xml file

2008-08-26 Thread Bender Heri
Logger.getLogger().getAppender( "SERVER_LOG" ); > -Original Message- > From: Reza Razavipour [mailto:[EMAIL PROTECTED] > Sent: Tuesday, August 26, 2008 2:30 AM > To: Log4J Users List > Subject: How to get values from log4j.xml file > > All, > > I have a log4j.xml file for my applicatio

RE: Passing log-time values to the Appender

2008-08-18 Thread Bender Heri
If your calling class which knows about the involved city runs in a separate thread context (for each city) you can use the MDC construct which is maintained on a per thread basis. Just put your city into MDC somewhere at the thread start when the city is known, and then in the MultifileAppender yo

RE: Syslog message is sent twice in the case no log4j configuration file is used

2008-07-09 Thread Bender Heri
My only guess is that setting the additivity flag by code does not have any effect. Or maybe a kind of activateOptions() on the logger must be performed. Why dont you fetch the RootLogger for appending your syslog appender, as you do in your config example? After the log call you clear the appende

RE: "additivity" attribute does not work for user-defined logger but works for root logger.

2008-07-07 Thread Bender Heri
om.create.CR in the log > file of com.create.CR"? > Yes. the foo.bar.XY and com.create.CR has some logging > messages as well that needs to go to the right log file. > > Thanks for helping me with it. > M. > > > Bender Heri wrote: > > > > Quest

RE: "additivity" attribute does not work for user-defined logger but works for root logger.

2008-07-07 Thread Bender Heri
Questions see inline. Heri > -Original Message- > From: Camer38 [mailto:[EMAIL PROTECTED] > Sent: Monday, July 07, 2008 3:24 PM > To: log4j-user@logging.apache.org > Subject: RE: "additivity" attribute does not work for > user-defined logger but works for root logger. > > > But in my

RE: "additivity" attribute does not work for user-defined logger but works for root logger.

2008-07-07 Thread Bender Heri
Now things getting clearer. Log4j maintains a logger hierarchy which is determined by the dot withing the logger names, similar to the package hierarchy in java.Example: Config: you declare a logger "foo.bar" and a root logger, both have one (the same) appender attached. Code: class foo.bar

RE: "additivity" attribute does not work for user-defined logger but works for root logger.

2008-07-03 Thread Bender Heri
Please provide your full log4j.xml. Heri > -Original Message- > From: Camer38 [mailto:[EMAIL PROTECTED] > Sent: Thursday, July 03, 2008 3:26 PM > To: log4j-user@logging.apache.org > Subject: "additivity" attribute does not work for > user-defined logger but works for root logger. > >

RE: Unable to display caller name in log info

2008-06-16 Thread Bender Heri
The FQCN is used for determinating the class which issued the log call. The log framework produces a callstack and searches backwards until it has found the supplied FQCN. The next entry is then taken for expanding the %C pattern in the layout. Normally, if you use the myLogger.debug() (et al.) me

RE: what to log

2008-06-16 Thread Bender Heri
I do not agree to yours "Logs are not for debugging". In heavy loaded multithreaded applications it could be the only way to debug. The DEBUG level IS definitively for debugging purpose. In production, I agree, the level should be INFO or higher. Heri > -Original Message- > From: Julius Da

RE: Recommended way of getting a logger

2008-06-16 Thread Bender Heri
There might be a problem if you use your own RepositorySelector wich maintains different Repositories depending on some context (MDC etc.). Utility classes whose methods can run in different contexts should fetch the logger each time where it is used. Heri > -Original Message- > From: J

RE: JDBCAppender

2008-05-08 Thread Bender Heri
Have you attached the appender to any logger? Heri > -Original Message- > From: Simonebernardi [mailto:[EMAIL PROTECTED] > Sent: Thursday, May 08, 2008 12:12 PM > To: log4j-user@logging.apache.org > Subject: [SPAM (DNS Blacklist)] - JDBCAppender - Sending mail server > found on list.dsbl.o

RE: - Setting logging levels

2008-05-06 Thread Bender Heri
If the string which you supply to logger.info() must first be constructed (normally a expensive operation which you dont want to do if info is not enabled) you can avoid this by: if ( logger.isInfoEnabled() ) { logger.info( prepareString( args ) ); } Without this surrounding if the string w

RE: Appender configuration question

2008-04-23 Thread Bender Heri
First: It is not recommended to include the log4j.xml into a jar file, especially not for third party library. Therefore the best way to solve your problem is either to remove the file from the jar or - even better - ask the vendor of the library to do that. If both is not possible, then you c

Re: Different Loggers for Different Instances of Same Class

2008-04-07 Thread Bender Heri
Hi The problem of different log files within the same app does not arise on the "main" classes of each job (this can be configured very easy through different appenders), but in all underlying framework and helper classes. If the log outputs of these underlying classes should be separated too,

RE: conditional logging of exception

2008-03-20 Thread Bender Heri
I dont really understand your thoughts why an error should not be logged along with stack trace, since it is an exceptional situation which should not occur often. Errors in logs are never "noise ratio". But your problem with classname, linenummer etc. can be solved if you use the overloaded lo

RE: Could not find root logger information Is this OK?

2008-03-19 Thread Bender Heri
I am not quite shure about property configuration (I work always with xml). But I suspect that the double configuration of the root logger ("rootLogger" and "rootCategory") causes your problem. But the both lines "rootLogger" and "rootCategory" means the same. The use of the term "Category" is d

Re: How to log binary data

2008-03-17 Thread Bender Heri
I for myself do such things when preparing the log message, i.e.: if (myLog.isDebugEnabled()) { myLog.debug( "received binary data:\n" + Conversions.byteArrayToHexDump( myByteArray ) ); } Annother apporach is to write your own renderer. In this case you would have also to define an own clas

RE: How can I set the output color of log4j?

2008-03-17 Thread Bender Heri
Since you do not specify which displaying application shall show colors I can give you advice how to achieve it within the eclipse console display: Configure two separate appenders. One for the levels WARN and higher and one for the levels INFO and lower. Assign them to the std.err and std.out.

RE: Log level problems

2008-02-26 Thread Bender Heri
Adding the additivity attribute should do the trick: BTW: the name "category" is deprecated. Use "logger" instead. Your cited configuration does not declare the referenced appender FILE. Heri > -Original Message- > From: Adrian Mitev [mailto:[EMAIL PROTECTED] > Sent: Tuesday, Februar

reasonable config for spring and hibernate

2007-12-20 Thread Bender Heri
Hi all In my actual project I work the first time with spring and hibernate. Configuring only a root logger on debug level overwhelms the log with messages from these frameworks. Even on INFO level there still are a lot of messages. I dont want to switch off the loggings from these frameworks

RE: [SPAM (Bayesain Analysis)] - Newbie help: Capturing Stdout and Stderr into log4j - Bayesian Filter detected spam

2007-11-29 Thread Bender Heri
Log4j is not designed for hooking any system event. It's mainly a very flexible output channel. Capturing the stdout: Assign your own OutputStream to System.out and you get all messages to stdout. These you can write then to any logger you wish. Exceptions are catched in the normal java way thro

RE: Advantages of using static log methods vs sub classes methods

2007-11-12 Thread Bender Heri
I would use wrappers, if at all, only for app or module wide special loggers (like fatal error alerting etc.), and only - if there is a special need to do something with the log event which cannot be done using the log4j framework - if some special initializing of the involved appenders is need

Re: FileAppender location question

2007-11-05 Thread Bender Heri
In eclipse you can set the working dir in the launch configurations second page "Arguments". Heri > -Original Message- > From: mbraunwart [mailto:[EMAIL PROTECTED] > Sent: Friday, November 02, 2007 8:07 PM > To: log4j-user@logging.apache.org > Subject: [SPAM (Bayesain Analysis)] - Re: Fil

RE: appenders with thread id affinity

2007-11-01 Thread Bender Heri
Hi I also suggest the approach with using MDC and custom filter. You probably want the outputs from each thread in separate files. If so, you have two possibilities: 1. Implementing a own RepositorySelector which holds different repositories for each thread / thread sub group. 2. Creating and c

RE: [SPAM (Bayesain Analysis)] - Can i instentiate the log4j logger object? - Bayesian Filter detected spam

2007-10-22 Thread Bender Heri
Hallo Michael About a year ago it was discussed to have a MultiFileAppender which can cover exactly this problem. The idea did not get over a sandbox project and is now sleeping. Using current version of log4j it is possible if you write your own repository selector. The default repository

RE: One appender on different loggers?

2007-10-11 Thread Bender Heri
Yes, you can. But be aware that at runtime it is the same instance of the appender. So you can't configure it differently. Heri > -Original Message- > From: Preuss, Jacqueline - ENCOWAY [mailto:[EMAIL PROTECTED] > Sent: Thursday, October 11, 2007 3:46 PM > To: Log4J Users List > Subject:

RE: [SPAM (Bayesain Analysis)] - How to always log the host name? - Bayesian Filter detected spam

2007-07-05 Thread Bender Heri
Put the hostname somewhere at app start into MDC: MDC.put( "hostname", myHostname ); The conversionPattern can resolve MDC values by using the switch %X{}. The ID in my example is "hostname" (without quotes). Heri > -Original Message- > From: Hans Schwaebli [mailto:[EMAIL PROTECTED]

RE: Urgent Please--How to create different log files with different property files in same webapplication

2007-06-28 Thread Bender Heri
you cannot add loggers or appenders by configuring them through a second property file. You must create and add them by code. In your Log4jSetup class: add a new Logger by code called "com.ck" and set its additivity flag to false. Then create your mail and R appenders and attach them to your new

RE: Re: Urgent Please--How to create different log files with different property files in same webapplication

2007-06-26 Thread Bender Heri
Your Implementation of repository selector is quite useless, because your distinction criteria relies on the current classloader. Log4j's default repository selector does this already for you. It is a singleton within the scope of one distinct classloader. If annother classloader comes onto stag

RE: Setting up log4j.xml

2006-12-05 Thread Bender Heri
essage- > From: chuanjiang lo [mailto:[EMAIL PROTECTED] > Sent: Tuesday, December 05, 2006 12:30 PM > To: Log4J Users List > Subject: Re: Setting up log4j.xml > > > On 12/5/06, Bender Heri <[EMAIL PROTECTED]> wrote: > > > > Log events which are sent to a spe

Re: Setting up log4j.xml

2006-12-05 Thread Bender Heri
Log events which are sent to a specialized Logger (=not Root Logger) will by default climb up the logger hierarchy until the root logger and serve every appender of every logger found on its way. Your example: a log event sent to logger named "loggingexample.Main" arrieves to this logger, does n

RE: Log4J System alerts

2006-11-30 Thread Bender Heri
t; > > Thanks Heri..thanks for ur help!!! > > I hope log4j.xml will also be read in the same manner as > > log4j.properties.. > > > > > > Bender Heri wrote: > >> > >> If you want to work with filters you must use log4j.xml > configuration >

RE: Log4J System alerts

2006-11-30 Thread Bender Heri
If you want to work with filters you must use log4j.xml configuration instead of log4j.properties. The properties configuration style does not support filter entries. It's anyway recommended to use xml configuration since: - the auto configuration mechanisme of log4j looks first for the log4j.xml

  1   2   3   >