You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by Bhavesh Patel <bh...@yahoo.com.INVALID> on 2018/11/26 05:20:51 UTC

Log4j2 Kafka application fails application startup

 Hi Log4j2 developers,                                   Do we have a status on bug (https://jira.apache.org/jira/browse/LOG4J2-2162)? Or is there a workaround for this issue? We are moving from log4j1 to log4j2 and will be using the Kafka appender for our production systems. This would be a major issue for us that if kafka server is down, the application itself fails to start up and would result in loss of revenues. IS there any recommendation to handle/bypass initializing the appender. We also have a rolling file appender which we can fallback to.
Regards,Bhavesh.


  

Re: Log4j2 Kafka application fails application startup

Posted by Ralph Goers <ra...@dslextreme.com>.
Yes, I can see why that happens. The KafkaManager’s start method would throw an exception that isn’t handled. Normally, just the component should fail not the whole configuration. Since the component is already wired in if it fails to start every attempt to write to it will silently fail. Any fix for this should include logic to reconnect and throw an exception if there is no producer so that the failover appender can deal with it.

Ralph



> On Nov 26, 2018, at 11:36 AM, Bhavesh Patel <bh...@yahoo.com.INVALID> wrote:
> 
> No that won't work. Failover works when the kafka servers are available at application startup time and goes down sometime after the application is up and running. That works fine for us. But if the kafka servers are not available during the application startup time, the application fails to start giving an exception. Availability/Unavailability of logging should not block an application from starting up. The same issue is mentioned in the bug reference I mentioned in my email.
> Regards,Bhavesh.
>    On Monday, November 26, 2018, 10:31:36 AM PST, Matt Sicker <bo...@gmail.com> wrote:  
> 
> You can use the FailoverAppender as a workaround. Set up a file appender or
> similar as your failover option so that logging still works. Adding a
> feature to replay logs to an appender when it comes back online, however,
> would be a separate task.
> 
> On Sun, 25 Nov 2018 at 23:21, Bhavesh Patel <bh...@yahoo.com.invalid>
> wrote:
> 
>>   Hi Log4j2 developers,                                  Do we have a
>> status on bug (https://jira.apache.org/jira/browse/LOG4J2-2162)? Or is
>> there a workaround for this issue? We are moving from log4j1 to log4j2 and
>> will be using the Kafka appender for our production systems. This would be
>> a major issue for us that if kafka server is down, the application itself
>> fails to start up and would result in loss of revenues. IS there any
>> recommendation to handle/bypass initializing the appender. We also have a
>> rolling file appender which we can fallback to.
>> Regards,Bhavesh.
>> 
>> 
>> 
> 
> 
> 
> -- 
> Matt Sicker <bo...@gmail.com>



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


Re: Log4j2 Kafka application fails application startup

Posted by Bhavesh Patel <bh...@yahoo.com.INVALID>.
 No that won't work. Failover works when the kafka servers are available at application startup time and goes down sometime after the application is up and running. That works fine for us. But if the kafka servers are not available during the application startup time, the application fails to start giving an exception. Availability/Unavailability of logging should not block an application from starting up. The same issue is mentioned in the bug reference I mentioned in my email.
Regards,Bhavesh.
    On Monday, November 26, 2018, 10:31:36 AM PST, Matt Sicker <bo...@gmail.com> wrote:  
 
 You can use the FailoverAppender as a workaround. Set up a file appender or
similar as your failover option so that logging still works. Adding a
feature to replay logs to an appender when it comes back online, however,
would be a separate task.

On Sun, 25 Nov 2018 at 23:21, Bhavesh Patel <bh...@yahoo.com.invalid>
wrote:

>  Hi Log4j2 developers,                                  Do we have a
> status on bug (https://jira.apache.org/jira/browse/LOG4J2-2162)? Or is
> there a workaround for this issue? We are moving from log4j1 to log4j2 and
> will be using the Kafka appender for our production systems. This would be
> a major issue for us that if kafka server is down, the application itself
> fails to start up and would result in loss of revenues. IS there any
> recommendation to handle/bypass initializing the appender. We also have a
> rolling file appender which we can fallback to.
> Regards,Bhavesh.
>
>
>



-- 
Matt Sicker <bo...@gmail.com>
  

Re: Log4j2 Kafka application fails application startup

Posted by Matt Sicker <bo...@gmail.com>.
You can use the FailoverAppender as a workaround. Set up a file appender or
similar as your failover option so that logging still works. Adding a
feature to replay logs to an appender when it comes back online, however,
would be a separate task.

On Sun, 25 Nov 2018 at 23:21, Bhavesh Patel <bh...@yahoo.com.invalid>
wrote:

>  Hi Log4j2 developers,                                   Do we have a
> status on bug (https://jira.apache.org/jira/browse/LOG4J2-2162)? Or is
> there a workaround for this issue? We are moving from log4j1 to log4j2 and
> will be using the Kafka appender for our production systems. This would be
> a major issue for us that if kafka server is down, the application itself
> fails to start up and would result in loss of revenues. IS there any
> recommendation to handle/bypass initializing the appender. We also have a
> rolling file appender which we can fallback to.
> Regards,Bhavesh.
>
>
>



-- 
Matt Sicker <bo...@gmail.com>