Comments (5)
Good idea, let me see what I can do.
How would you want the custom text to show up? Would a prefix [MyCustomText] be fine?
from nlog.targets.syslog.
Thanks @graffen and @tsbrooks. I'd encourage using Layouts for this, for a couple reasons:
- it's the NLog standard that's documented in the core project and users are likely to be familiar with
- it has renderer macros, not just static strings
- it supports more message formats (though in the simplest use, would completely obsolete
customprefix
) - it's fairly easy to implement: initialize a
Layout
object (or more than one if you want more granular layouts for portions of the output), then call its Render method and pass in theLogEventInfo
object you have. It returns a string.
from nlog.targets.syslog.
BTW, if you want a hand testing and defaulting to a standard, protocol-compliant remote syslog layout, let me know - happy to help. I'd also document it here.
from nlog.targets.syslog.
@troy Thanks, I wasn't aware of that feature. As I see it, this voids this issue (#2) completely, since the Layout can simply be configured to contain whatever identifier string you would like.
I'll probably remove the customprefix again and simply add a pointer to the documentation.
from nlog.targets.syslog.
@graffen: There's a couple code changes that need to happen for Layouts to work. I haven't implemented it, so I may be missing elements, but it looks like you'll need:
- to inherit from the abstract class TargetWithLayout
- getters and setters for at least one Layout object like this, and probably overwriting the default value
- evaluating the layout with the log event like this
from nlog.targets.syslog.
Related Issues (20)
- Name of wrapped target has "_wrapped" suffix HOT 3
- 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
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.