6 messages in org.apache.logging.log4j-userRE: Database logging: server name
FromSent OnAttachments
James StaufferJun 24, 2004 11:54 am 
Sullivan, Sean C - MWTJun 24, 2004 11:59 am 
James StaufferJun 24, 2004 12:00 pm 
Sullivan, Sean C - MWTJun 24, 2004 12:09 pm 
James StaufferJun 24, 2004 12:23 pm 
Ceki GülcüJun 25, 2004 2:56 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:RE: Database logging: server nameActions...
From:James Stauffer (jsta@spscommerce.com)
Date:Jun 24, 2004 12:23:19 pm
List:org.apache.logging.log4j-user

Thanks.

Would it be useful to automatically do that? e.g. Make a new column in logging_event and have DBAppender (1.3)automatically insert it?

-----Original Message----- From: Sullivan, Sean C - MWT [mailto:Sull@menlolog.com] Sent: Thursday, June 24, 2004 2:10 PM To: Log4J Users List Subject: RE: Database logging: server name

We have not seen any performance problems.

-Sean

-----Original Message----- From: James Stauffer [mailto:jsta@spscommerce.com] Sent: Thursday, June 24, 2004 12:01 PM To: 'Log4J Users List' Subject: RE: Database logging: server name

Is there a way to avoid setting it get each request? Or is that probably irrelevant performance wise (we have somewhat long requests)?

-----Original Message----- From: Sullivan, Sean C - MWT [mailto:Sull@menlolog.com] Sent: Thursday, June 24, 2004 2:00 PM To: Log4J Users List Subject: RE: Database logging: server name

In our environment, we store the server hostname in the MDC.

First, we put the server hostname in a static variable:

static private final String strServerHostname = getServerHostname();

For each HTTP request, we execute this code:

MDC.put(SERVER_HOSTNAME_KEY, strServerHostname); MDC.put(REQUEST_SERVER_NAME_KEY, req.getServerName()); MDC.put(REQUEST_REMOTE_ADDRESS_KEY, req.getRemoteAddr());

-Sean

-----Original Message----- From: James Stauffer [mailto:jsta@spscommerce.com] Sent: Thursday, June 24, 2004 11:55 AM To: 'Log4J Users List' Subject: Database logging: server name

Since we have 16 servers running one product we would like the logs to include the server name. Is there a way to make that happen automatically? I was using an MDC value but I found that it wasn't always being set. It appears that since the servlet engine created multiple threads before my static code ran to set the MDC it was only set on one thread. I don't want to set it on every request because it never changes. Ideas?