lorilio | 1 Dec 2004 12:42
Picon

RE: File log for file class


                      Lutz Michael                                                                                                     
                      <michael.h.lutz <at> s        To:       "'Log4J Users List'" <log4j-user <at> logging.apache.org>                          
                      iemens.com>              cc:                                                                                     
                                               Subject:  RE: File log for file class                                                   
                      2004.11.30 17:56                                                                                                 
                      Please respond to                                                                                                
                      "Log4J Users                                                                                                     
                      List"                                                                                                            

My is ##

may I ask why you want to do this?
## Perhaps for to organize the logs. But, there is one form more usual? How
do you use?

I think this would be extremely unusual.
If this is a requirement :-), why is it a requirement?
##But if I need use, there is one form?

-----Original Message-----
From: lorilio <at> evoluti.com.br [mailto:lorilio <at> evoluti.com.br]
Sent: Tuesday, November 30, 2004 4:04 PM
To: Log4J Users List
Subject: File log for file class

Hi,

      how can I create one file log for one class?
I need to specify the name file of log in the class file?
(Continue reading)

Adriano Labate | 1 Dec 2004 17:06

Multiple DailyRollingFileAppender on the same file : renaming fails

Hi,

I just resolved a problem with the DailyRollingFileAppender and I just want to share my experience with
others. If it can help someone...

When it was time to rollover the file, I got the error:

"log4j:ERROR Failed to rename [c:/temp/mspak/monitoring/transferService.log] to [c:/temp/mspak/monitoring/transferService.log.2004-11-25.log]."

I search on Google for this error and found around 200 results and realized that it was a problem for a lot of people.

As I use log4j with the Oracle JVM I supposed that it was an Oracle issue with I/O or permissions. After a lot of
discussions with the Oracle support, it was definitely not the case.

I noted that a lot of discussions talked about the possibility that the file has a handle on it that prevents
log4j to rename the file.

To be sure I installed and run 2 tools from www.sysinternals.com : Handle and Process Explorer.

Running Handle I got :

--------------
C:\>handle -u transferservice.log
Handle v2.2
Copyright (C) 1997-2004 Mark Russinovich
Sysinternals - www.sysinternals.com

oracle.exe         pid: 984    AUTORITE NT\SYSTEM        C:\TEMP\MSPAK\monitoring\transferService.log
oracle.exe         pid: 984    AUTORITE NT\SYSTEM        C:\TEMP\MSPAK\monitoring\transferService.log
--------------
(Continue reading)

Pramodh Peddi | 2 Dec 2004 00:38

SyslogAppender not working

Hi,

I am not experienced enough in SyslogAppender, because this is the first
time I am using it. I am trying to get the basic functionality working.
I am running the application in a Linux machine (Suse).

This is the code I have:

***********************code**********************

mySyslogger = (SystemLog)Logger.getLogger("sso1", myFactory);

SyslogAppender syslogApp = new SyslogAppender(layout, "localhost",
org.apache.log4j.net.SyslogAppender.LOG_USER);

addAppender(syslogApp);

mySyslogger.debug(message);//also have mySyslogger.info(message), but
neither works

**********************code**************************

Can anyone throw some light on why the above code does not work? I
checked in /var/log/messages file in my Linux machine. Nothing goes into
that file.

I also tried org.apache.log4j.net.SyslogAppender.LOG_MAIL, but did not
see anything going into /var/log/mail file.

Can any one help me on this
(Continue reading)

Paul Smith | 2 Dec 2004 00:41

Re: SyslogAppender not working

if you're adding this programatically, I'd suggest not to forget to call:

syslogApp.activateOptions();

this goes for all Appenders really.

cheers,

Paul Smith

Pramodh Peddi wrote:

>Hi,
>
>I am not experienced enough in SyslogAppender, because this is the first
>time I am using it. I am trying to get the basic functionality working.
>I am running the application in a Linux machine (Suse).
>
> 
>
>This is the code I have:
>
>***********************code**********************
>
>mySyslogger = (SystemLog)Logger.getLogger("sso1", myFactory);
>
> 
>
>SyslogAppender syslogApp = new SyslogAppender(layout, "localhost",
>org.apache.log4j.net.SyslogAppender.LOG_USER);
(Continue reading)

Adriano Labate | 2 Dec 2004 12:43

RE: Multiple DailyRollingFileAppender on the same file : renaming fails

Hi,

I tested a log4j configuration where I have 2 DailyRollingFileAppender pointing to the same physical file
and having a different PatternLayout. The first one is used by the root logger and the second one by an
explicit logger.

In my previous post, I used this configuration on a Oracle JVM, now on a standard Sun JVM.

In both cases, when it's time to rollover the file, the renaming fails.

The reason is that each appender maintains a handle on the file resulting in two handles, that creates a lock
and the renaming always fails and the previous log content is lost.

-----------------------------------------------------
Handle v2.2
Copyright (C) 1997-2004 Mark Russinovich
Sysinternals - www.sysinternals.com

java.exe           pid: 1876   C:\transferService.log
java.exe           pid: 1876   C:\transferService.log
-----------------------------------------------------

I wonder whether it is the correct behavior ? It seems to me that log4j has a full control on its configuration
and could handle this situation. Maybe this could be fixed in version 1.3 ?

Adriano Labate

-----Message d'origine-----
De : Adriano Labate [mailto:adriano.labate <at> sportaccess.com] 
Envoyé : mercredi, 1 décembre 2004 17:06
(Continue reading)

PIGEYRE Bastien | 2 Dec 2004 15:17
Favicon

multiple instance of an application


	Hi,

	I have a problem with log4J. I have an application which can be launch several times. I would like to create a
logger file for each with a different name:
	eg:
	myAppli1.log
	myApply2.log
	...

the appender is always the same : "myApply"
but each sessio instantiate his own logger.

Here follows the the result I got.
When I launch a first application, It creates a good log file. When I launch a second application it creates a
new log file (all is good) but the logging of my two application are stored in the last file created....

did someone has an idea to solve my problem?

thanks in advance,

> Bastien PIGEYRE
> 
> 
Currimbhoy Shahyan | 2 Dec 2004 15:55
Picon

Unable to populate 'Class', 'Method', 'Line' and 'File' fields wi thin Chainsaw


I am using Chainsaw to view logs generated via Log4j however I can't seem to
get anything inside the 'Class', 'Method', 'Line' and 'File' fields within
Chainsaw. I seem to get '?' inside all those fields.
I am trying to set the layout using Conversion Pattern however it doesn't
seem to recognize it. No matter what I put in the conversion pattern, it
only populates the standard fields (level, logger, time, thread, message).
When I tried setting the Conversion pattern for the Console Appender, I can
view the correct values in the Class, Method, Line and File fields.
Is there something additional I need to do in order to view these fields
inside Chainsaw. I am using a normal SocketAppender with the following
snipet from Log4j.xml:

<!-- Chainsaw Client -->
	<appender name= "CHAINSAW_CLIENT" class=
"org.apache.log4j.net.SocketAppender" >
    	<param name= "RemoteHost" value= "165.226.223.135"/>
    	<param name= "Port" value= "4445" />
    	<layout class="org.apache.log4j.PatternLayout">
		<!-- NO MATTER WHAT I PUT IN THE CONVERSION PATTERN, IT HAS
NO EFFECT ON THE LOGS WITHIN CHAINSAW-->
			<param name="ConversionPattern" value="%c{2} %L %F
%C %M %p %m %n" />
		</layout>
    </appender >

-----Original Message-----
From: Adriano Labate [mailto:adriano.labate <at> sportaccess.com]
Sent: Thursday, December 02, 2004 6:44 AM
To: Log4J Users List
(Continue reading)

Scott Deboy | 2 Dec 2004 16:33

RE: Unable to populate 'Class', 'Method', 'Line' and 'File' fields within Chainsaw

SocketAppender doesn't use a layout - socketAppender sends serialized logging events over the wire.

Are you using a log4j1.2.8 jar on the source side?

If so, you can't get location info fields in Chainsaw V2 using a SocketAppender - the serialization of
events changed between 1.2.8 and 1.3.

You can receive events from a 1.2.8 SocketAppender, but only if the events don't contain location info.

If you're using a 1.2.8 jar on the source side, you can still get location info in Chainsaw by following these steps:
1. On the source side, define a FileAppender using a conversion pattern that includes line/file/method
etc patterns.
2. In Chainsaw, define a LogFilePatternReceiver, specifying the URL to your log file and the logFormat
(pattern) in the file (see the JavaDoc - available from Chainsaw's help menu, for info no how to configure a
LogFilePatternReceiver).  
3. Don't forget to set 'tailing' to true if you want to view the events in Chainsaw as they are written to the file.

If you're using a 1.3 jar on the source side, add a 'locationInfo' param (set to true) to the SocketAppender
configuration and Chainsaw will display location info.

Hope that helps

Scott

-----Original Message-----
From:	Currimbhoy Shahyan [mailto:Shahyan.Currimbhoy <at> siemens.com]
Sent:	Thu 12/2/2004 6:55 AM
To:	'Log4J Users List'
Cc:	
Subject:	Unable to populate 'Class', 'Method', 'Line' and 'File' fields within Chainsaw
(Continue reading)

Pramodh Peddi | 2 Dec 2004 16:49

RE: SyslogAppender not working

Hi,

I added the syslogApp.activateOptions() line, but still does not work.

There are other appenders (RollingFileAppender) working within the same
application, but SyslogAppender bails on me. Other appenders does not
have syslogApp.activateOptions() and works however.

Are there any other ideas? I appreciate the help.

Pramodh.

Pramodh Peddi

Software Engineer

v 781-674-2738

f  781-674-2760

www.imprivata.com

People are talking about OneSign:

"We were spending 35% of our IT time on password-related issues, says
Paula Chesbrough, CIO of Eagle Bank in Everett, Mass. "We've reduced
that workload to 10%."  Network World, 8/9/04

"Imprivata Quells Management Burdens"

(Continue reading)

Ceki Gülcü | 2 Dec 2004 16:54
Picon
Gravatar

RE: SyslogAppender not working


Is your syslogd daemon accepting packets from the network? By default, most 
Syslog configurations do not.

At 04:49 PM 12/2/2004, you wrote:
>Hi,
>
>I added the syslogApp.activateOptions() line, but still does not work.
>
>There are other appenders (RollingFileAppender) working within the same
>application, but SyslogAppender bails on me. Other appenders does not
>have syslogApp.activateOptions() and works however.
>
>
>
>Are there any other ideas? I appreciate the help.
>
>  --

Ceki Gülcü

  The complete log4j manual:  http://qos.ch/eclm
  Professional log4j support: http://qos.ch/log4jSupport  

Gmane