log4j issue
Hi, I get an error message when trying to log. I don't have a console appender entry in my configuration file. Still,. My configurator code looks like: URL url = LoggingConfigurator.class.getResource(/log.xml); DOMConfigurator.configure(url.getFile()); I keep getting this error everytime. log4j:ERROR Attempted to append to closed appender named [console] Sudhakar
log4j error
Hi, I get an error message when trying to log. I don't have a console appender entry in my configuration file. Still, I keep getting this error everytime. log4j:ERROR Attempted to append to closed appender named [console] Sudhakar
Re: Chainsaw 2 filtering wishes...
2. Any way to show elapsed time between visible rows - instead of just the event time ? That's probably a performance killer at this stage. We could probably easily allow you to Select two rows, and provide either a status bar and/or popup option to display the time difference, but doing it for every single row is probably something I would prefer not to do at this stage. This should not be a performance killer tabModel.getValueAt(timestampcol, row) - tabModel.getValueAt(timestampcol, row-1) isn't that much of a killer is it (it is constant) ? (it should ofcourse be an option - not something always done) 5. Let me view the logger hiearchy and enable/disable/filter on that (Look at Lumbermill for inspiration - its gui is actually quite good regarding enabling/disabling parents/children levels) Got a link for Lumbermill? (too busy, I mean lazy, to do a google search). Lazy you ;) http://traxel.com/lumbermill/ Check it out - there hierachy management is better than LF5 IMHO ;) cheers, Paul Smith - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Chainsaw 2 filtering wishes...
On Wed, 2003-07-30 at 17:14, Max Rydahl Andersen wrote: 2. Any way to show elapsed time between visible rows - instead of just the event time ? That's probably a performance killer at this stage. We could probably easily allow you to Select two rows, and provide either a status bar and/or popup option to display the time difference, but doing it for every single row is probably something I would prefer not to do at this stage. This should not be a performance killer tabModel.getValueAt(timestampcol, row) - tabModel.getValueAt(timestampcol, row-1) isn't that much of a killer is it (it is constant) ? (it should ofcourse be an option - not something always done) Doing this for every single row would be... Perhaps you didn't mean that, I was under the impression you wanted each row to display a time value which is the elapsed time since the previous row. Or maybe you did mean this. Also from a purest point of view, each row would have to know what row number it was, and be able to find out the previous row which is a bit 'coupley'. It certainly might be possible, but me personally I would just highlight two rows and click an action to tell me the difference. Lazy you ;) http://traxel.com/lumbermill/ Check it out - there hierachy management is better than LF5 IMHO ;) Many thx! Paul - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Customising Chainsaw
My log message is a complex XML element since there was other information, such as hardware, message ID, replacement parameters etc. that I needed in the message. A log file consists of multiple Log message elements. A Log message would be something like Log LevelInfo/Level Date07-07-2003T12:43/Date HardwareCamera1/Hardware SourceTracking/Source MessageIDMSG1023/MessageID ... /Log To view the logs, I need to have columns for the elements in the log XML (Hardware, source etc.) instead of one single column for the message. Also, level date would have to be extracted from the Log XML element. The message text has to be looked up, based on the message ID, from a resource file for a locale. I couldn't make out from the Chainsaw home page whether this would be easy to support/add on to Chainsaw or whether I should just roll my own. Regards Milind - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Chainsaw 2 filtering wishes...
2. Any way to show elapsed time between visible rows - instead of just the event time ? That's probably a performance killer at this stage. We could probably easily allow you to Select two rows, and provide either a status bar and/or popup option to display the time difference, but doing it for every single row is probably something I would prefer not to do at this stage. This should not be a performance killer tabModel.getValueAt(timestampcol, row) - tabModel.getValueAt(timestampcol, row-1) isn't that much of a killer is it (it is constant) ? (it should ofcourse be an option - not something always done) Doing this for every single row would be... Perhaps you didn't mean that, I was under the impression you wanted each row to display a time value which is the elapsed time since the previous row. Or maybe you did mean this. Also from a purest point of view, each row would have to know what row number it was, and be able to find out the previous row which is a bit 'coupley'. It certainly might be possible, but me personally I would just highlight two rows and click an action to tell me the difference. I did mean it for every row - but I meant it for the visible view, I want the difference in times between the visual rows dependent on the filtered rows. /max - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Setting multiple log threshold in multi-threaded environment
Hello: I am a new user of log4j. I am trying to use it in a multi-user, multi-threaded environment. In this environment, each thread performs operations on behalf of a unique user. Each user may have different log threshold levels. For example, we may want to log only FATAL messages = for user 'joe', whereas we may wish to log ALL messages for user 'pete'. As per the recommendations, I have created a static logger instance across all the threads. However, I can now only set a single log threshold level across all the threads. I realize I can simulate multiple log threshold levels (one per thread - for each user) by using MDC, but that is expensive. Am I missing anything? Should I be creating one logger object per thread? Thanks for your input. -- Shachin. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Customising Chainsaw
Since Chainsaw supports all of LoggingEvent's capabilities (MDC, properties, NDC), I would think a transform of this format into log4j's dtd would be straightforward if you made the extra fields properties. Chainsaw could then be used to view the events. One thing to remember is that Chainsaw renders properties as a single entry - a comma-delimited set of name/value pairs (a single field). -Original Message- From: Milind Rao [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 30, 2003 12:42 AM To: Log4J Users List Subject: Customising Chainsaw My log message is a complex XML element since there was other information, such as hardware, message ID, replacement parameters etc. that I needed in the message. A log file consists of multiple Log message elements. A Log message would be something like Log LevelInfo/Level Date07-07-2003T12:43/Date HardwareCamera1/Hardware SourceTracking/Source MessageIDMSG1023/MessageID ... /Log To view the logs, I need to have columns for the elements in the log XML (Hardware, source etc.) instead of one single column for the message. Also, level date would have to be extracted from the Log XML element. The message text has to be looked up, based on the message ID, from a resource file for a locale. I couldn't make out from the Chainsaw home page whether this would be easy to support/add on to Chainsaw or whether I should just roll my own. Regards Milind - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Customising Chainsaw
Okay, then I guess I'll have to roll my own since I'd like to see different columns for different elements in the message so I can sort and filter the logs based on those elements. But I'll take a look at chainsaw before I start anyway. Thanks. On a different note, I hope log4j will start using schemas instead of dtds soon. On Wed, 30 Jul 2003 08:01:25 -0700, Scott Deboy wrote: Since Chainsaw supports all of LoggingEvent's capabilities (MDC, properties, NDC), I would think a transform of this format into log4j's dtd would be straightforward if you made the extra fields properties. Chainsaw could then be used to view the events. One thing to remember is that Chainsaw renders properties as a single entry - a comma-delimited set of name/value pairs (a single field). -Original Message- From: Milind Rao [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 30, 2003 12:42 AM To: Log4J Users List Subject: Customising Chainsaw My log message is a complex XML element since there was other information, such as hardware, message ID, replacement parameters etc. that I needed in the message. A log file consists of multiple Log message elements. A Log message would be something like Log LevelInfo/Level Date07-07-2003T12:43/Date HardwareCamera1/Hardware SourceTracking/Source MessageIDMSG1023/MessageID ... /Log To view the logs, I need to have columns for the elements in the log XML (Hardware, source etc.) instead of one single column for the message. Also, level date would have to be extracted from the Log XML element. The message text has to be looked up, based on the message ID, from a resource file for a locale. I couldn't make out from the Chainsaw home page whether this would be easy to support/add on to Chainsaw or whether I should just roll my own. Regards Milind - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Regards Milind - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Customising Chainsaw
If you used Chainsaw 2 and defined these extra fields as properties, you could filter on them (QuickFilter with a regexp), but sorting would not work. I like the idea of providing the MDC entries and properties as separate columns (comma-delimited name/value pairs are almost less than useful)...I'll see what I can do.. I'm also probably going to add the ability to configure how events are routed to unique tabs: Right now, unique combinations of an app and machine (properties with pre-defined names) result in the event routed to unique tabs, but I see value in allowing someone to choose to route all WARNING, ERROR, DEBUG messages to separate tabs instead, or being able to select a property or MDC entry as the identifier for routing to unique tabs. -Original Message- From: Milind Rao [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 30, 2003 7:45 AM To: Log4J Users List Subject: RE: Customising Chainsaw Okay, then I guess I'll have to roll my own since I'd like to see different columns for different elements in the message so I can sort and filter the logs based on those elements. But I'll take a look at chainsaw before I start anyway. Thanks. On a different note, I hope log4j will start using schemas instead of dtds soon. On Wed, 30 Jul 2003 08:01:25 -0700, Scott Deboy wrote: Since Chainsaw supports all of LoggingEvent's capabilities (MDC, properties, NDC), I would think a transform of this format into log4j's dtd would be straightforward if you made the extra fields properties. Chainsaw could then be used to view the events. One thing to remember is that Chainsaw renders properties as a single entry - a comma-delimited set of name/value pairs (a single field). -Original Message- From: Milind Rao [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 30, 2003 12:42 AM To: Log4J Users List Subject: Customising Chainsaw My log message is a complex XML element since there was other information, such as hardware, message ID, replacement parameters etc. that I needed in the message. A log file consists of multiple Log message elements. A Log message would be something like Log LevelInfo/Level Date07-07-2003T12:43/Date HardwareCamera1/Hardware SourceTracking/Source MessageIDMSG1023/MessageID ... /Log To view the logs, I need to have columns for the elements in the log XML (Hardware, source etc.) instead of one single column for the message. Also, level date would have to be extracted from the Log XML element. The message text has to be looked up, based on the message ID, from a resource file for a locale. I couldn't make out from the Chainsaw home page whether this would be easy to support/add on to Chainsaw or whether I should just roll my own. Regards Milind - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Regards Milind - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Customising Chainsaw
I had just glanced over MDC/NDC in the log4j docs. I'll go over it again. Thanks. On Wed, 30 Jul 2003 08:19:40 -0700, Scott Deboy wrote: If you used Chainsaw 2 and defined these extra fields as properties, you could filter on them (QuickFilter with a regexp), but sorting would not work. I like the idea of providing the MDC entries and properties as separate columns (comma-delimited name/value pairs are almost less than useful)...I'll see what I can do.. I'm also probably going to add the ability to configure how events are routed to unique tabs: Right now, unique combinations of an app and machine (properties with pre-defined names) result in the event routed to unique tabs, but I see value in allowing someone to choose to route all WARNING, ERROR, DEBUG messages to separate tabs instead, or being able to select a property or MDC entry as the identifier for routing to unique tabs. -Original Message- From: Milind Rao [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 30, 2003 7:45 AM To: Log4J Users List Subject: RE: Customising Chainsaw Okay, then I guess I'll have to roll my own since I'd like to see different columns for different elements in the message so I can sort and filter the logs based on those elements. But I'll take a look at chainsaw before I start anyway. Thanks. On a different note, I hope log4j will start using schemas instead of dtds soon. On Wed, 30 Jul 2003 08:01:25 -0700, Scott Deboy wrote: Since Chainsaw supports all of LoggingEvent's capabilities (MDC, properties, NDC), I would think a transform of this format into log4j's dtd would be straightforward if you made the extra fields properties. Chainsaw could then be used to view the events. One thing to remember is that Chainsaw renders properties as a single entry - a comma-delimited set of name/value pairs (a single field). -Original Message- From: Milind Rao [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 30, 2003 12:42 AM To: Log4J Users List Subject: Customising Chainsaw My log message is a complex XML element since there was other information, such as hardware, message ID, replacement parameters etc. that I needed in the message. A log file consists of multiple Log message elements. A Log message would be something like Log LevelInfo/Level Date07-07-2003T12:43/Date HardwareCamera1/Hardware SourceTracking/Source MessageIDMSG1023/MessageID ... /Log To view the logs, I need to have columns for the elements in the log XML (Hardware, source etc.) instead of one single column for the message. Also, level date would have to be extracted from the Log XML element. The message text has to be looked up, based on the message ID, from a resource file for a locale. I couldn't make out from the Chainsaw home page whether this would be easy to support/add on to Chainsaw or whether I should just roll my own. Regards Milind - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Regards Milind - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Regards Milind - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
newbie: configuring log4j for EJB's inside weblogic
Hi, I would prefer not to put the log4j jar file into each EJB application jar file, so I have tried to put the log4j jar into the classpath and then simply start the app server. I expected my EJB's to find the Logger class, but was disappointed to get a ClassNotFound Exception. Is it possible to use log4j without deploying the jar with each application jar? The other question I have is when to configure log4j. I think it would be overkill to put this code into each EJB implementation. Would I be right in thinking that I should create a startup class that the application server runs when booting and that this class must call the configureAndWatch() method??? Regards, Andreas
RE: newbie: configuring log4j for EJB's inside weblogic
I've done two seperate setups for configuring log4j on weblogic (both are 6.1sp4). #1 log4j.jar and its config file on the server classpath (i.e., the classpath built in startWebLogic.sh) #2 Each enterprise deployable handling its own config. In my ear, this is accomplished by including a war file with just a single servlet whose sole purpose is to configure log4j from an env-entry. Option #1 is serviceable but not very flexible. All classes running within that server must then use that configuration. And further more, you will not be able to hot-deploy components. Why write a startup class (i.e., weblogic startup class as opposed to starup servlet) to acheive this? #1 does the same thing... -Original Message- From: Andreas Bothner [ MTN - Innovation Centre ] [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 30, 2003 12:05 PM To: [EMAIL PROTECTED] Subject: newbie: configuring log4j for EJB's inside weblogic Hi, I would prefer not to put the log4j jar file into each EJB application jar file, so I have tried to put the log4j jar into the classpath and then simply start the app server. I expected my EJB's to find the Logger class, but was disappointed to get a ClassNotFound Exception. Is it possible to use log4j without deploying the jar with each application jar? The other question I have is when to configure log4j. I think it would be overkill to put this code into each EJB implementation. Would I be right in thinking that I should create a startup class that the application server runs when booting and that this class must call the configureAndWatch() method??? Regards, Andreas - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
discreet log types
Hello, I'm looking at creating a logging package for our applications (web non-web). The reason for yet-another-logger is that I want discreet logging types, not hierarchical levels. I've built this kind of a package before for previous projects, and ended up building the whole thing because I didn't think log4j could do what I wanted (that was several years ago). Now I'm building another one, and looking at the current version of log4j, and having read much of Ceki's book (which I highly recommend!), I'm thinking that there's got to be a way of re-configuring (bending?) log4j to do what I need. I don't think it's that far off. Basically, I want to be able to enable/disable logging for a particular class or package by type, and each type is totally independent of every other type. Some examples of types might be: Fatal, Error, Timing, CodeBlock, ControlPoint, DBAccess, Info, etc. There is no implicit ordering between these various types, so levels are inappropriate. What I want to be able to do is to turn on/off each type independently, so that I can turn on Timing without having to also turn on Info, or be able to turn on CodeBlock without turning on Error. I also want the users of my package to be able to define additional types and register them with the logger at runtime (via code or xml ???). Oh yeah, I also need to have the logger reload the config file (or some portion of it) on a regular basis so that we can change the enabled types without bouncing the app-server or restarting the application. I was thinking if I tried to tie all my types to a single level, and did something with the log-level filtering to enable/disable by package or class, that would get me close. I'm not sure how I'd tie in the type. I'd probably have to programatically update the log-level filters with updates to handle config changes at runtime. Thoughts, ideas, concerns???Any comments are gratefully accepted! :) --- regards --- Larry -- Larry Young The Dalmatian Group www.dalmatian.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: discreet log types
Hi Larry, This is where you would probably delve into the MDC/NDC/Properties usage. At each 'type' point/location in code I would add a MDC/NDC/Property (whatever works best) at the point, and remove it afterwards where appropriate. The log events generated between these places would then have a Level, belong to a Logger (you're class/interface/logger name), and have additional information for your 'type'. Then it is just a matter of configuring Filters at the appender level to filter out events that you're not interested in for that appender. You might have to develop some custom Filter classes to meet your needs, or re-use/build on the Filter classes that are in Log4j, but that's the approach I would use. Configuration reloading is free out of the box, just register a File Watchdog (see the PropertyConfigurator.configureAndWatch(file, watchTime) method, plus the DOMConfigurator obviously has this too). I hope this helps you. cheers, Paul Smith On Thu, 2003-07-31 at 09:25, Larry Young wrote: Hello, I'm looking at creating a logging package for our applications (web non-web). The reason for yet-another-logger is that I want discreet logging types, not hierarchical levels. I've built this kind of a package before for previous projects, and ended up building the whole thing because I didn't think log4j could do what I wanted (that was several years ago). Now I'm building another one, and looking at the current version of log4j, and having read much of Ceki's book (which I highly recommend!), I'm thinking that there's got to be a way of re-configuring (bending?) log4j to do what I need. I don't think it's that far off. Basically, I want to be able to enable/disable logging for a particular class or package by type, and each type is totally independent of every other type. Some examples of types might be: Fatal, Error, Timing, CodeBlock, ControlPoint, DBAccess, Info, etc. There is no implicit ordering between these various types, so levels are inappropriate. What I want to be able to do is to turn on/off each type independently, so that I can turn on Timing without having to also turn on Info, or be able to turn on CodeBlock without turning on Error. I also want the users of my package to be able to define additional types and register them with the logger at runtime (via code or xml ???). Oh yeah, I also need to have the logger reload the config file (or some portion of it) on a regular basis so that we can change the enabled types without bouncing the app-server or restarting the application. I was thinking if I tried to tie all my types to a single level, and did something with the log-level filtering to enable/disable by package or class, that would get me close. I'm not sure how I'd tie in the type. I'd probably have to programatically update the log-level filters with updates to handle config changes at runtime. Thoughts, ideas, concerns???Any comments are gratefully accepted! :) --- regards --- Larry -- Larry Young The Dalmatian Group www.dalmatian.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]