You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by Ceki Gülcü <ce...@qos.ch> on 2003/06/25 21:49:45 UTC
Fwd: RE: FW: cvs commit:
jakarta-log4j/src/java/org/apache/log4j/net SocketAppender.java
Forwarding here with explicit permission of Scott Deboy.
>Subject: RE: FW: cvs commit: jakarta-log4j/src/java/org/apache/log4j/net
>SocketAppender.java
>Date: Wed, 25 Jun 2003 12:04:02 -0700
>From: "Scott Deboy" <Sc...@VirtualDesign.Net>
>To: Ceki Gülcü <ce...@qos.ch>
>
>Thanks...I haven't seen the machinename property show up as null...I'll
>check it out..maybe add a finally/null check for the property to make sure
>it is set to 'unknown'.
>
>I thought I'd give a little background as to why I added the
>'overrideProperties' property and the reasoning behind log4japp supporting
>the odd concatenation:
>
>1. The overrideProperties is used when I want to forward events to
>SimpleSocketServer (from an server app for example). If the
>overrideproperties didn't exist, the log4japp and log4jmachinename would
>be the name of the machine running SimpleSocketServer, not the 'source'
>machine.
>
>2. The reason I provided 'concatenation' of the log4japp property is
>because static configuration via the XML file wasn't flexible enough for
>my needs. I end up using the app property to create unique tabs for each
>user running on the same machine (using the same xml configuration file).
>
>For example, I'd set the log4japp property to 'test application' in the
>xml configuration file.
>
>Then, in my application at runtime, I set the log4japp system property to
>'user XXXXX'. The concatenation allows me to see that I'm running the
>test application as user XXXX.
>
>The xml configuration by itself wasn't enough - all events for all users
>for that app would end up on the same tab.
>
>The system property also wasn't enough - all events for that user,
>regardless of app - would end up on the same tab.
>
>Obviously there are shortfalls to using the system property for user
>context - only works in single user applications or applets..not in app
>servers..
>
>Allowing the user to pick which fields were used to build the unique tabs
>(MDC, properties, etc) would be ideal but could be a lot of work...
>
>I'd still like this functionality. Can you think of another way?
>
>Thanks again,
>Scott
>
>-----Original Message-----
>From: Ceki Gülcü [mailto:ceki@qos.ch]
>Sent: Wednesday, June 25, 2003 11:31 AM
>To: Scott Deboy
>Subject: Re: FW: cvs commit: jakarta-log4j/src/java/org/apache/log4j/net
>SocketAppender.java
>
>
>At 10:42 AM 6/25/2003 -0700, you wrote:
> >My apologies..I'll remember to run the unit tests prior to committing
> >changes.
> >
> >(assuming I broke the tests because most of the code in here is to
> >support
> >the event routing in chainsaw).
>
>I don't think event routing code is involved.
>
>AFAIT, on my machine the following code leaves localMachine null.
>
> try {
> localMachine = InetAddress.getLocalHost().getHostName();
> } catch (UnknownHostException uhe) {
> try {
> localMachine = InetAddress.getLocalHost().getHostAddress();
> } catch (UnknownHostException uhe2) {
> localMachine = "unknown";
> }
> }
>
>This causes problems when the event is sent out.
>
>
> >-----Original Message-----
> >From: ceki@apache.org [mailto:ceki@apache.org]
> >Sent: Wednesday, June 25, 2003 10:21 AM
> >To: jakarta-log4j-cvs@apache.org
> >Subject: cvs commit: jakarta-log4j/src/java/org/apache/log4j/net
> >SocketAppender.java
> >
> >
> >ceki 2003/06/25 10:21:18
> >
> > Modified: src/java/org/apache/log4j/net SocketAppender.java
> > Log:
> >
> >
> > Reverting to previous version as the version from the sandbox does
> > not
> >
> > pass unit tests
> >
--
Ceki For log4j documentation consider "The complete log4j manual"
ISBN: 2970036908 http://www.qos.ch/shop/products/clm_t.jsp
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: log4j-dev-help@jakarta.apache.org