You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 2, 2018. It is now read-only.
I am trying to keep most of log4net configuration externalized in xml for our apps, but with something like the UDP appender, I would need to route the log messages to a different address and/or port depending on what region (dev, test, or prod) the app is running in. I was thinking I could add the GelfUdpAppender in the xml configuration with a bogus address (or localhost), and then run-time re-configure the address. I tried this, and I got no errors, but the messages aren't delivered to the graylog listener, so I'm guessing that at this point, the appender has already created it's socket connection using the address from the xml configuration, and won't do so again. Do you have a recommendation on how such a thing could be accomplished? I could maintain region-specific log4net configurations, and bootstrap log4net with the right one, but I don't like the duplication (maintenance) that comes with this option. I think I could also just do all instantiation of the gelf appender in code - this is workable, I just prefered having MOST of the configuration of all appenders in the xml (for example, keeping all conversion patterns for all appenders in one place).
Thanks in advance for any suggestions you might have!
The text was updated successfully, but these errors were encountered:
Apologies - I think I figured it out - I was setting appender.RemostHostName at runtime instead of appender.RemoteAddress. With that change, it appears to work as desired.
I am trying to keep most of log4net configuration externalized in xml for our apps, but with something like the UDP appender, I would need to route the log messages to a different address and/or port depending on what region (dev, test, or prod) the app is running in. I was thinking I could add the GelfUdpAppender in the xml configuration with a bogus address (or localhost), and then run-time re-configure the address. I tried this, and I got no errors, but the messages aren't delivered to the graylog listener, so I'm guessing that at this point, the appender has already created it's socket connection using the address from the xml configuration, and won't do so again. Do you have a recommendation on how such a thing could be accomplished? I could maintain region-specific log4net configurations, and bootstrap log4net with the right one, but I don't like the duplication (maintenance) that comes with this option. I think I could also just do all instantiation of the gelf appender in code - this is workable, I just prefered having MOST of the configuration of all appenders in the xml (for example, keeping all conversion patterns for all appenders in one place).
Thanks in advance for any suggestions you might have!
The text was updated successfully, but these errors were encountered: