Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Log the payload the NLogViewer/network target to the InternalLogger #1708

Closed
PureKrome opened this issue Oct 13, 2016 · 7 comments
Closed

Log the payload the NLogViewer/network target to the InternalLogger #1708

PureKrome opened this issue Oct 13, 2016 · 7 comments

Comments

@PureKrome
Copy link

PureKrome commented Oct 13, 2016

Type: Question
NLog version: 4.3.10
Platform: .Net 4.5
Current NLog config

<?xml version="1.0" encoding="utf-8"?>

<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      autoReload="true"
      throwExceptions="true"
      internalLogFile="c:\temp\nlog-debug-log.txt"
      internalLogLevel="Trace"
      >

  <!-- NLog example: https://github.com/nlog/nlog/wiki/Examples -->
  <targets async="true">
    <target name="Sentinel"
            xsi:type="NLogViewer"
            address="udp://127.0.0.1:9999"
            layout="ssss-seeing-if-this-overrides"/>
  </targets>

  <rules>
    <logger name="*" minlevel="Trace" appendTo="Sentinel" />
  </rules>

</nlog>

Hi 👋
I'm trying to figure out a way to see the payload that is sent over the wire when using an NLogViewer target. My reasoning is that we use a viewer called Sentinal and I'm starting to use properties to attach more meta data, per log entry. (We use Serilog + Serilog.sinks.nlog right now).

If i can see the exact payload that is sent over the wire to sentinal I can then determine if it's worth my time in trying to fix their application to handle dynamic columns (1 per property, for example) or maybe flatten the properties into the end of the rendered Message.

So - is there an easy way to see this data?

I'm used to using FIDDLER for snooping this type of info but this isn't HTTP traffic.

NOTE: If you noticed, i've added a internalLogLevel="Trace" attribute to see if the internal tracing might output/dump the payload context, but it doesn't. (I don't put that on any of my nlog files .. just this R&D).

cheers!

@304NotModified
Copy link
Member

It looks like this isn't logged to the InternalLogger. We could add it in the next version. The code should added to the NetworkTarget

@PureKrome
Copy link
Author

Oh nice then :)

  1. would an example be provided if it's added, in the next release?
  2. could this issue be updated (with a link to a PR) if it's added in, please?

@304NotModified
Copy link
Member

304NotModified commented Oct 13, 2016

  1. would an example be provided if it's added, in the next release?

Do you mean, how to enable? That will be internalLogLevel="Trace"

  1. could this issue be updated (with a link to a PR) if it's added in, please?

Yes, also I think you will get a notification when the PR is linked to this issue :)

@304NotModified 304NotModified changed the title How can I see the payload to an NLogViewer target? Log the payload the NLogViewer/netwerok target to the InternalLogger Oct 13, 2016
@304NotModified 304NotModified changed the title Log the payload the NLogViewer/netwerok target to the InternalLogger Log the payload the NLogViewer/network target to the InternalLogger Oct 13, 2016
@304NotModified 304NotModified added this to the 4.3.11 milestone Oct 13, 2016
@PureKrome
Copy link
Author

I said

  1. would an example be provided if it's added, in the next release?

and you said

Do you mean, how to enable? That will be internalLogLevel="Trace"

and I was actually really trying to say ..

would an example be provided that uses this NetworkTarget if that is the way we will need to see this payload data. Otherwise, what does NetworkTarget have to do with it?

@304NotModified
Copy link
Member

Sorry about the confusion.

NLogViewer inherits from NetworkTarget, so if we log at NetworkTarget level, this is fixed for NLogViewer :)

@304NotModified
Copy link
Member

I have added some internal logs in NLog 4.3.11. https://www.nuget.org/packages/NLog/4.3.11

@PureKrome
Copy link
Author

Thank you kindly!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants