logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jason Tholstrup <jason.tholst...@theebsgroup.com>
Subject Re: Chainsaw Tab identifier
Date Wed, 05 Mar 2008 22:20:52 GMT
Hey Scott,

Thanks so much for the help.  I've started creating a custom version  
of the SocketHubAppender which implements the buffer you mentioned  
(Yanked the code from the 1.3 branch and it works like a charm.   
Thanks for mentioning it).

I also tried to set the "application" property into this custom  
Appender using the code from SocketAppender as a template.  I am not  
getting the application property to come across the wire, nor can I  
seem to get any property to come across the wire.  I get the  
remoteSourceInfo, hostname, and log4jid to come across but I'm  
guessing that is happening on the chainsaw side.  From digging through  
the 1.2 and 1.3 code bases I noticed that the LoggingEvent seems to  
handle properties differently.   The 1.2 code base uses the mdc to set  
the property in and the 1.3 code base uses the properties map.  Am I  
running into another incompatibility issue between log4j 1.2.15 on the  
server side and chainsaw (log4j 1.3 version) or am I completely  
missing the point of how I set properties?



Code snippet from socketHubAppender where I set properties on the  
logging event.  I've debugged through here and verified that the  
properties exist in the mdc on the LoggingEvent.

	/**
	 * Append an event to all of current connections.
	 */
	public void append(LoggingEvent event) {
		// if no event or no open connections, exit now
		if (event == null || oosList.size() == 0)
			return;

		// set up location info if requested
		if (locationInfo) {
			event.getLocationInformation();
		}
		if (buffer != null) {
			buffer.add(event);
		}
		if (application != null) {
                         // set application name
			event.setProperty("application", application);
		}
                         // set property all the time name
		event.setProperty("randomProp", "hello");

         ...



	/**
	 * The <b>App</b> option takes a string value which should be the  
name of the application getting logged. If property was already set  
(via system
	 * property), don't set here.
	 */
	public void setApplication(String lapp) {
		this.application = lapp;
	}

	/**
	 * Returns value of the <b>Application</b> option.
	 */
	public String getApplication() {
		return application;
	}

Jason Tholstrup
Software Engineer
jason.tholstrup@theebsgroup.com



On Mar 3, 2008, at 4:49 PM, Scott Deboy wrote:

> log4j 1.3 is abandoned - the useful bits were (mostly) backported to
> log4j  1.2.15 with a few 'companion' downloads providing the non-core
> functionality added to 1.3.
>
> There are a few caveats:
> - Chainsaw V2 trunk (built against log4j 1.2.15) has not yet been
> released.  Once it is released, location info will work again.
> -  The version of Chainsaw available via web start is based on log4j
> 1.3, so location info won't work
> - The component, receivers and zeroconf 'companions' have not yet been
> officially released - the 'extras' companion has been officially
> released (meaning any not-yet-released companions need to be built  
> from
> source..)
>
> Since Chainsaw V2 built against log4j 1.2.15 (along with the receivers
> and other companions) have yet to be officially released, it's a  
> pain to
> build Chainsaw on the trunk (maven dependencies on snapshots...ug).
>
> As for compatibility between log4j 1.2.15 (and Chainsaw V2) and prior
> versions, Chainsaw V2 should work fine with log4j 1.2.9 (including
> support for location info).
>
> Everything we wanted to keep -should- already be backported to log4j
> 1.2.15 + companions..the sockethubappender buffer issue is one that  
> was
> missed..
>
> Once everything is released, it'll be a lot easier to build from
> sources.
>
>
> Scott Deboy
> Principal Engineer
> COMOTIV SYSTEMS
> 111 SW Columbia Street Ste. 950
> Portland, OR  97201
> Office: 503.224.7496
> Direct Line: 503.821.6482
> Cell: 503.997.1367
> Fax: 503.222.0185
> sdeboy@comotivsystems.com
> www.comotivsystems.com
>
>
> -----Original Message-----
> From: Jason Tholstrup [mailto:jason.tholstrup@theebsgroup.com]
> Sent: Monday, March 03, 2008 2:30 PM
> To: Log4J Users List
> Subject: Re: Chainsaw Tab identifier
>
> I'm sure you get this a lot but after reading quite a few posts I am
> still kind of confused:
>
> The lineage between the 1.3 and 1.2 branches is very hazy.  From what
> i can tell 1.3 is essentially dead and that 1.2 is the recommended
> version to use.
>
> As for chainsaw, should I be using the v2 that is available directly
> on apache's web site?  This appears to be based on version 1.3 code if
> I read correctly.  Should I instead be using version 1.2.15 and using
> the chainsaw client available from there as well as using log4j 1.2.15
> on my appender side?  I've seen posts mentioning getting the latest
> 1.2.15 version from svn to get the "right" version of chainsaw.  Is
> that now current with the latest release or do I still need to tread
> into the waters of a nightly build?
>
> On the back porting effort, what is the status there?  Is that
> completed and that is the purpose of 1.2.15?  Is that just a partial
> back-port with more to come?  Is that a partial back-port and that's
> the end of the road?
>
> And finally we have a third party app we were trying to get logging
> working under that is using 1.2.9.  Could we safely drop in 1.2.15 and
> be able to configure our appenders as you describe (we have access to
> the log4j.properties file on the server)?
>
> Thanks for being patient and walking me through all of this.  You've
> easily save me a couple of days of bumbling around trying to get this
> to work.
>
> Jason Tholstrup
> Software Engineer
> jason.tholstrup@theebsgroup.com
>


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message