Code Monkey home page Code Monkey logo

Comments (5)

otherdave avatar otherdave commented on May 26, 2024

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.

luigiberrettini avatar luigiberrettini commented on May 26, 2024

Message transmission involves:

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.

otherdave avatar otherdave commented on May 26, 2024

@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.

otherdave avatar otherdave commented on May 26, 2024

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.

otherdave avatar otherdave commented on May 26, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.