Re: Adding more than one syslog appenders with different hostname and port at runtime

2023-10-19 Thread Ralph Goers
Why do you need to do it through code? I would recommend getting it working using a configuration (XML or JSON) and then, if you still need to, use that as your guide for how to create the RoutingAppender. Ralph > On Oct 19, 2023, at 11:53 AM, Ganesh S wrote: > > I have made some modification

Re: Adding more than one syslog appenders with different hostname and port at runtime

2023-10-19 Thread Ganesh S
Can anyone please help me on this issue? On Fri, Oct 20, 2023, 12:23 AM Ganesh S wrote: > I have made some modification in the previous code that I had sent and > there is no error or warning while configuration initialization, but logs > are not going to the destination server > But if I try th

Re: Adding more than one syslog appenders with different hostname and port at runtime

2023-10-19 Thread Ganesh S
I have made some modification in the previous code that I had sent and there is no error or warning while configuration initialization, but logs are not going to the destination server But if I try the same thing using log4j2.xml it is working fine. Below is my updated code: LoggerContext ctx = (

Re: Adding more than one syslog appenders with different hostname and port at runtime

2023-10-19 Thread Ganesh S
Trying to configure routing appender programmatically Unable to figure out completely. The current code for this is as below, which is not currently working. Need help to complete this code. ConfigurationBuilder builder = ConfigurationBuilderFactory.newConfigurationBuilder(); AppenderComponentBuil

Re: Adding more than one syslog appenders with different hostname and port at runtime

2023-10-19 Thread Ganesh S
Is there any reference for creating routing appender programmatically ? On Thu, Oct 19, 2023, 9:35 AM Ralph Goers wrote: > Why are you doing it this way? Can you not just use the RoutingAppender? > https://logging.apache.org/log4j/2.x/manual/appenders.html#RoutingAppender > > Ralph > > > On Oct