Comments (5)
My nlog target config for my app. I borrowed most of it from you sample/test app (thanks for that!). The syslog server is always running at 172.31.1.1.
<target xsi:type="sl:Syslog" name="syslogger">
<sl:layout xsi:type="SimpleLayout" text="${message}${exception:format=ToString,StackTrace}" />
<sl:enforcement>
<sl:splitOnNewLine>true</sl:splitOnNewLine>
<sl:transliterate>true</sl:transliterate>
<sl:replaceInvalidCharacters>true</sl:replaceInvalidCharacters>
<sl:truncateFieldsToMaxLength>true</sl:truncateFieldsToMaxLength>
<sl:truncateMessageTo>1024</sl:truncateMessageTo>
</sl:enforcement>
<sl:messageCreation>
<sl:facility>Local4</sl:facility>
<sl:rfc>Rfc5424</sl:rfc>
</sl:messageCreation>
<sl:messageSend>
<sl:protocol>UDP</sl:protocol>
<sl:udp>
<sl:server>172.31.1.1</sl:server>
<sl:port>514</sl:port>
</sl:udp>
<sl:tcp>
<sl:server>172.31.1.1</sl:server>
<sl:port>514</sl:port>
<sl:reconnectInterval>3</sl:reconnectInterval>
<sl:framing>octetCounting</sl:framing>
</sl:tcp>
</sl:messageSend>
</target>
from nlog.targets.syslog.
Message transmission involves:
- SyslogTarget line 54
- AsyncLogger line 36
- AsyncLogger line 76
- LogEventMsgSet line 58
- MessageTransmitter line 28
- Udp and Tcp
When the target is initialized both an UdpClient and a TcpClient are created.
Since UDP is connectionless this should not impact sends as happens for TCP where a proper reconnect is implemented.
If I remember well the test application works when you send messages, then start the fake syslog server and then send new messages.
I suggest using the test application against your server to check if the problem is elsewhere.
Another temporary solution could be reconfiguring the target programmatically when you see the server is up (INotifyPropertyChanged is implemented and reinitializes the target).
from nlog.targets.syslog.
@luigiberrettini Thanks for the replies! Sorry to go silent for a bit, I've had to step away from this for a few days. I should be able to run the test you suggested today or tomorrow and I'll report back.
from nlog.targets.syslog.
Ok, looks like I'm the problem :)
Ran my server and stopped the rsyslog service. Then I launched your GUI test app (after configuring it to point to my system) and sent off some logs. Verified nothing was logged. Started rsyslog and sent a few more logs from your GUI and they showed up.
Either my previous test was flawed, or I've got another error somewhere. I'll dig into it and report back if something else is wacky. Thanks for the help & advice!
Does your GUI & nlog config buffer UDP syslogs, or otherwise hang onto them? I didn't look too closely at the config but I noticed a lag of many seconds between clicking the "Info Event" button and the log message making it to my rsyslog log file.
from nlog.targets.syslog.
Yep, this was totally my fault. Closing this out. It looks like in my testing (originally), my syslog server changed IP addresses and therefore wasn't logging. Sorry for the hassle!
from nlog.targets.syslog.
Related Issues (20)
- Infinite retries and potential log entries lost upon delivery failure HOT 2
- Delivery issues result in infinite retries HOT 1
- Delivery issues can result in lost log entries HOT 4
- UnobservedTaskException thrown on configuration reload HOT 3
- Superfluous catch of OperationCanceledException
- Support for .NET Framework not needed
- Multiple build services are used
- How to get started is missing HOT 1
- Extensions section missing in sample configuration HOT 1
- NLog version in README is wrong
- Build badges in README are not relevant
- NuGet publication fails with Powershell error
- NuGet publication unable to find packages
- Is the target compatible with the new NLog extension configuration? HOT 32
- Improper dependency handling with .NET Framework application HOT 5
- structured logging - Escaping special characters for ${all-event-properties} layout renderer HOT 1
- Syslog logging just randomly stops HOT 4
- Add support for TLS (TLS server certificate validation)
- Truncation not Working HOT 1
- Infinite retries by default = memory leak by default HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nlog.targets.syslog.