Re: log4j does not log when the application crashes for some reason

2009-06-29 Thread Suresh Krishna

Hi Ceki,

The problem is that it is the application that crashes but _not_ due to 
log4j. We have lot of info/warn/error statements in probably each and 
every class. But when the appplication crashes for some reason, the log 
file does not have the recent stack trace before the application died, 
but it just has a message that an error occurred and could not log.


On the condole the following message appears :

*** This message goes through  to LOG4J
*** This message bypasses the  / LOG4J ***

But in the log file, i see only the first message but not the second one.

Any ideas ?

Thanks,
Krishna

Ceki Gulcu wrote:

Hello Krishna,

If your application runs out of memory at an arbitrary point in code,
log4j will not be invoked, and cannot log. However, you also seem to
imply that log4j is somehow responsible for the runtime exception. In
that case, could you please be more specific?

Suresh Krishna wrote:

Hi,

We are using the the log4j for our applications. Recently we have 
come to a blocking point that, the log4j does not log the exceptions 
or what happened to the log file. Our application may crash with the 
*out of memory error* or some *runtime exception*. In both the cases 
the log4j does not log the exception is there any way to deal 
with this ?


Appreciate any response on this.

Thanks,
Krishna





-
To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
For additional commands, e-mail: log4j-user-h...@logging.apache.org



Re: log4j does not log when the application crashes for some reason

2009-06-29 Thread Ceki Gulcu

Hello Krishna,

If your application runs out of memory at an arbitrary point in code,
log4j will not be invoked, and cannot log. However, you also seem to
imply that log4j is somehow responsible for the runtime exception. In
that case, could you please be more specific?

Suresh Krishna wrote:

Hi,

We are using the the log4j for our applications. Recently we have come 
to a blocking point that, the log4j does not log the exceptions or what 
happened to the log file. Our application may crash with the *out of 
memory error* or some *runtime exception*. In both the cases the log4j 
does not log the exception is there any way to deal with this ?


Appreciate any response on this.

Thanks,
Krishna



--
Ceki Gülcü
Logback: The reliable, generic, fast and flexible logging framework for Java.
http://logback.qos.ch

-
To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
For additional commands, e-mail: log4j-user-h...@logging.apache.org



log4j does not log when the application crashes for some reason

2009-06-29 Thread Suresh Krishna

Hi,

We are using the the log4j for our applications. Recently we have come 
to a blocking point that, the log4j does not log the exceptions or what 
happened to the log file. Our application may crash with the *out of 
memory error* or some *runtime exception*. In both the cases the log4j 
does not log the exception is there any way to deal with this ?


Appreciate any response on this.

Thanks,
Krishna

-
To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
For additional commands, e-mail: log4j-user-h...@logging.apache.org



Re: How to setup Log4j for standalone app

2009-06-29 Thread nani2ratna

Sorted out.
Didnt call proper loader.

thanks
rs.K

nani2ratna wrote:
> 
> Hi,
> 
> I used log4j earlier and setit up in my windows machine 2 years back.
> Now I am using Opensuse. I wrote one class using eclipse.
> I put log4j.jar and commons.logging in buildpath.
> the class is like this
> 
> package log4jtest;
> 
> import java.io.FileInputStream;
> import java.io.IOException;
> import java.util.Properties;
> 
> import org.apache.log4j.Logger;
> import org.apache.log4j.PropertyConfigurator;
> 
> public class LoggingTest {
> 
>   public static final Logger log = Logger.getLogger(LoggingTest.class);
>   public static final String LOG_PROPERTIES_FILE =
> "/home/ratnak/Work/Workspace/TestProject/resources/log4j.xml";
> 
>   public static void main(String[] args) {
>   //  new LoggingTest();
>   log.debug("This is debug statment");
>   log.fatal("This is fatal error");
>   log.info("This is information");
>   System.out.println("Program finished running");
>   }
> 
>   public LoggingTest() {
>   initializeLogger();
>   log.info("Log4JDemo - leaving the constructor ...");
>   }
> 
>   private void initializeLogger() {
>   Properties logProperties = new Properties();
> 
>   try {
>   logProperties.load(new 
> FileInputStream(LOG_PROPERTIES_FILE));
>   PropertyConfigurator.configure(logProperties);
>   log.info("Logging initialized.");
>   System.out.println("Load Initialized");
>   System.out.println();
>   } catch (IOException e) {
>   throw new RuntimeException("Unable to load logging 
> property "
>   + LOG_PROPERTIES_FILE);
>   }
>   }
> 
> }
> 
> 
> Is there anything wrong inthat.
> Every thing execut properly.
> But I dont know why logging.log file is not getting generated.
> Can you please tell me.
> 
> Thanks
> RS.K
> 

-- 
View this message in context: 
http://www.nabble.com/How-to-setup-Log4j-for-standalone-app-tp24253672p24254979.html
Sent from the Log4j - Users mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
For additional commands, e-mail: log4j-user-h...@logging.apache.org



AW: What causes RollingFileAppender to not roll over

2009-06-29 Thread Bender Heri
A common reason for not rolling over is that more than one appender instance 
write to the same file, i.e. more than one file handle are open on the same 
physical file.
Heri 

-Ursprüngliche Nachricht-
Von: DOUTCH GARETH-GDO003 [mailto:gareth.dou...@motorola.com] 
Gesendet: Montag, 29. Juni 2009 12:47
An: Log4J Users List
Betreff: [SPAM (Bayesain Analysis)] - What causes RollingFileAppender to not 
roll over - Bayesian Filter detected spam

Hi there,
 
I have a number of machines where my RollingFileAppenders are not rolling over, 
resulting in huge log files. Is there any particular cause of this that I might 
be able to fix / avoid / workaround?
 
Cheers,
 
Gareth
 


-
To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
For additional commands, e-mail: log4j-user-h...@logging.apache.org



How to setup Log4j for standalone app

2009-06-29 Thread nani2ratna

Hi,

I used log4j earlier and setit up in my windows machine 2 years back.
Now I am using Opensuse. I wrote one class using eclipse.
I put log4j.jar and commons.logging in buildpath.
the class is like this

package log4jtest;

import java.io.FileInputStream;
import java.io.IOException;
import java.util.Properties;

import org.apache.log4j.Logger;
import org.apache.log4j.PropertyConfigurator;

public class LoggingTest {

public static final Logger log = Logger.getLogger(LoggingTest.class);
public static final String LOG_PROPERTIES_FILE =
"/home/ratnak/Work/Workspace/TestProject/resources/log4j.xml";

public static void main(String[] args) {
//  new LoggingTest();
log.debug("This is debug statment");
log.fatal("This is fatal error");
log.info("This is information");
System.out.println("Program finished running");
}

public LoggingTest() {
initializeLogger();
log.info("Log4JDemo - leaving the constructor ...");
}

private void initializeLogger() {
Properties logProperties = new Properties();

try {
logProperties.load(new 
FileInputStream(LOG_PROPERTIES_FILE));
PropertyConfigurator.configure(logProperties);
log.info("Logging initialized.");
System.out.println("Load Initialized");
System.out.println();
} catch (IOException e) {
throw new RuntimeException("Unable to load logging 
property "
+ LOG_PROPERTIES_FILE);
}
}

}


Is there anything wrong inthat.
Every thing execut properly.
But I dont know why logging.log file is not getting generated.
Can you please tell me.

Thanks
RS.K
-- 
View this message in context: 
http://www.nabble.com/How-to-setup-Log4j-for-standalone-app-tp24253672p24253672.html
Sent from the Log4j - Users mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
For additional commands, e-mail: log4j-user-h...@logging.apache.org



What causes RollingFileAppender to not roll over

2009-06-29 Thread DOUTCH GARETH-GDO003
Hi there,
 
I have a number of machines where my RollingFileAppenders are not
rolling over, resulting in huge log files. Is there any particular cause
of this that I might be able to fix / avoid / workaround?
 
Cheers,
 
Gareth