Programmatically creating tcp appender #918
-
Is there a way to create a TCP appender programmatically? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 6 replies
-
Yes, you would follow the same approach as the answers to this Stack Overflow question regarding logback programmatic configuration, but instead of constructing and configuring those other appenders, you would construct and configure a |
Beta Was this translation helpful? Give feedback.
-
Thanks @philsttr phillsttr! How do I get LogstashTcpSocketAppender from the context? I'm able to get logback core SSL appender like this:
basically what I need to do is stop and start the appender to reload the Keystore/Truststore, I can do this with SSLSocketAppender. |
Beta Was this translation helpful? Give feedback.
Yes, you would follow the same approach as the answers to this Stack Overflow question regarding logback programmatic configuration, but instead of constructing and configuring those other appenders, you would construct and configure a
LogstashTcpSocketAppender
. The xml element names seen in the readme correlate to setter/adder methods on the appender and its nested objects.