External apps: Log4JXml target for Sentinel LogViewer
Background
Starting with NLog 6, the Log4JXml UDP target is no longer in the core NLog package; it lives in NLog.Targets.Network.
Sentinel LogViewer receives and parses Log4J XML (UDP and files). External applications should be able to stream logs over UDP to the viewer, similar to the test app in this repo.
References in this repository:
- Package:
NLog.Targets.Network (e.g. 6.0.0 in Sentinel.LogViewer.TestApp)
- Sample
nlog.config: testapp/Sentinel.LogViewer.TestApp/nlog.config (xsi:type="Log4JXml", address="udp://…")
- Programmatic setup:
app/Sentinel.LogViewer.TestLogging/NLogTestLoggingConfig.cs
NLog 5 → 6: Many setups used Chainsaw; on NLog 6 use Log4JXml (format remains compatible with the viewer).
Product idea (automation)
We are considering having our own software support this rollout on already deployed systems:
- Discover existing installations that use NLog (or are candidates for LogViewer integration) on a machine or in a defined scope.
- Detect whether the Log4JXml / network logging setup is already present (
NLog.Targets.Network, nlog.config target, logger rules, UDP endpoint).
- If missing, apply the necessary changes in a controlled way: add the NuGet package (or equivalent deployment dependency) and extend or update
nlog.config (and related config) so the Log4JXml target points at the LogViewer.
This would reduce manual hunting across servers and repos and keep behavior consistent. Details (permissions, idempotency, rollback, NLog 5 vs 6) are still to be defined.
Goal (manual / process track)
- Find deployments that use NLog and should feed the LogViewer (dev/test/prod).
- Check whether
NLog.Targets.Network is missing (NLog 6 + Log4JXml in config or code).
- Add the matching package version (aligned with the main
NLog package).
- Update
nlog.config (or code-based config): Log4JXml target, UDP address/port (e.g. viewer default), logger rules.
Proposed approach
Open questions
- Default UDP host/port per environment?
- NLog 6 migration only, or keep NLog 5 (
Chainsaw) where it still runs?
- Rollout: manual vs. script/CI vs. built-in installer/updater?
- What may the tool modify (config only vs. binaries/packages)? Admin rights? Backup before change?
- Firewall/permissions for UDP to the viewer?
Success criteria
Affected applications send Log4J XML over UDP; LogViewer shows events without viewer-side changes. Where automation is used, rediscovery does not duplicate targets and failed changes are visible and reversible.
External apps: Log4JXml target for Sentinel LogViewer
Background
Starting with NLog 6, the Log4JXml UDP target is no longer in the core
NLogpackage; it lives inNLog.Targets.Network.Sentinel LogViewer receives and parses Log4J XML (UDP and files). External applications should be able to stream logs over UDP to the viewer, similar to the test app in this repo.
References in this repository:
NLog.Targets.Network(e.g. 6.0.0 inSentinel.LogViewer.TestApp)nlog.config:testapp/Sentinel.LogViewer.TestApp/nlog.config(xsi:type="Log4JXml",address="udp://…")app/Sentinel.LogViewer.TestLogging/NLogTestLoggingConfig.csNLog 5 → 6: Many setups used
Chainsaw; on NLog 6 useLog4JXml(format remains compatible with the viewer).Product idea (automation)
We are considering having our own software support this rollout on already deployed systems:
NLog.Targets.Network,nlog.configtarget, logger rules, UDP endpoint).nlog.config(and related config) so the Log4JXml target points at the LogViewer.This would reduce manual hunting across servers and repos and keep behavior consistent. Details (permissions, idempotency, rollback, NLog 5 vs 6) are still to be defined.
Goal (manual / process track)
NLog.Targets.Networkis missing (NLog 6 + Log4JXml in config or code).NLogpackage).nlog.config(or code-based config): Log4JXml target, UDP address/port (e.g. viewer default), logger rules.Proposed approach
NLog,nlog.config,Chainsaw/Log4JXml, NLog version).PackageReference/packages.config+ config snippet (includingextensionsif required).Open questions
Chainsaw) where it still runs?Success criteria
Affected applications send Log4J XML over UDP; LogViewer shows events without viewer-side changes. Where automation is used, rediscovery does not duplicate targets and failed changes are visible and reversible.