My java application use log4j(flume appender with AsyncAppender) to log to remote log server.
If log server is down, log4j will try to reconnect a few times,but then my java application was shutdown.Is there any possible my java application goes normal with the exception of log4j?
the right solution is :
use AsyncAppender with FlumeAppender. more detail see http://edwardsbean.github.io/blog/2014/01/14/flume-in-action-1/
You have two choices
Catch the exception and ignore it
set the UnsafeMode property to true.
Related
We have been trying to start the claimcenter server from tomcat. The server is getting started even though it throws exception with the message "ClaimCenter unable to start" in the logs. Please find the log details below.
gw.pl.exception.GWLifecycleException: An exception was thrown while starting a component. Setting runlevel to NODAEMONS
Caused by: gw.pl.exception.GWLifecycleException:Messaging plugin does not implement MessageTransport interface error
Possible causes -
The xyzMessageTransport class failed to instantiate due to invalid parameters.
A class which is not implementation of MessageTransport inteface configured under
MessageTransport plugin. check messaging-config.xml.
Also - specify plugin name or attach whole log if possible.
We are sending all trace logs to our NLog logger. (with a trace listener)
Nlog is configured to work with DryIoC.
Locally this works perfect, however, in Azure (web app), the first trace message is logged, before we could create our DryIoc container. Even a PreAppStartMethodAttribute does not help, as the trace log has occurred even before the PreAppStartMethodAttribute.
Is there a way to do some initialization tasks before azure logs it's first trace message?
I found a work-around by using an async wrapper that prevents NLog from flushing the data until the container/configuration has been initiliazed.
Using:
Hazelcast 3.6.1
Log4j 2.5
slf4j 1.7.13
Hazelcast client using Log4j cannot log the Membership 'printout'
Member [localhost]:19325
This client is being initialized programmatically (not via spring).
Instead, exception is thrown by logging infrastructure
2016-03-09 15:49:34,195 hz.client_0_qv-core.event-4 ERROR An exception occurred processing Appender STDOUT java.lang.IllegalArgumentException: can't parse argument number:
Member [localhost]:19325
at java.text.MessageFormat.makeFormat(MessageFormat.java:1429)
at java.text.MessageFormat.applyPattern(MessageFormat.java:479)
at java.text.MessageFormat.<init>(MessageFormat.java:362)
at java.text.MessageFormat.format(MessageFormat.java:840)
at org.apache.logging.log4j.message.MessageFormatMessage.formatMessage(MessageFormatMessage.java:94)
The error isn't related to the number of cluster members.
Server is able to print the message just fine using the same codebase.
I can provide the full stack trace if needed.
Defining logging configuration with system property: -Dhazelcast.logging.type solved the issue.
Have you tried to bind Hazelcast logging directly to log4j?
http://docs.hazelcast.org/docs/3.6/manual/html-single/index.html#logging-configuration
Given a Log4Net logger on my C# ASP.NET application, how can I get the logging level of the root logger?
The specific error case I am trying to trap is that when the root is set to trace it causes an error in NHibernate because of the version we are on, so I would just like to trap that and shut down the WCF service in the case where someone sets the log level incorrectly.
I'm sure someone else has tried to do this before, so I would like to benefit from prior knowledge. My google fu is weak tonight. Help me StackOverflow, you're my only hope.
var rootLogger = ((Hierarchy) LogManager.GetRepository()).Root;
if (rootLogger.Level == Level.Trace) …
I'm written an application which uses a library (Jabber stream objects) which internally uses log4j. When I deploy the application, there are no errors. However after some time, I could see lots of error message which look like this:
[#|2013-02-26T12:48:56.147+0000|SEVERE|oracle-glassfish3.1.2|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=365;_ThreadName=SelectWorker 1;|java.lang.IllegalStateException: WEB9031: WebappClassLoader unable to load resource [org.apache.log4j.spi.NOPLoggerRepository], because it has not yet been started, or was already stopped
at org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1401)
at org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1359)
at org.apache.log4j.LogManager.getLoggerRepository(LogManager.java:197)
at org.apache.log4j.LogManager.getLogger(LogManager.java:228)
at org.apache.log4j.Logger.getLogger(Logger.java:117)
I have log4j.jar inside the WEB-INF/lib directory of my application, along with the external library (JSO.jar)
The issue [1] looked similar, but doesn't seem to be the same.
[1] Web service is not working on GlassFish
I've found that this happens when I redeploy a Servlet and went away when I overridden destroy() for my Servlet and did some cleanup there.