-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Feature: OnNewLogFile Method Hook / Event Handler #3814
Comments
Hi! Thanks for opening your first issue here! Please make sure to follow the issue template - so we could help you better! |
Supposing you were on board with the concept, would you welcome a PR for this, from a new contributor? |
I doubting if this really suitable for NLog Core. Another option is to make the File target extensible enough to handle this.
I think c# events are a better way for this |
related #1249 |
Sounds like you are really looking for the Header-Layout on the FileTarget. <target name="logfile" xsi:type="File">
<header>--- ${assembly-version} started on ${longdate} ---</header>
</target> |
🤣 Yes. Yes, it does indeed. |
Some combine it with |
Closing this as the header layout is fine here and no upvotes |
See this StackOverflow question:
https://stackoverflow.com/questions/60335551/nlog-onnewlogfile-handler
On the assumption that it doesn't currently exist, would you be open to adding such a config option?
NLog version: vNext?
Platform: N/A
Current NLog config: N/A?
Why do we need it?
So that (if desired) you can ensure that All log files contain relevant contextual information. Aiding in debugging production issues.
An example of the XML config, if relevant.
IDK.
Possibly something very similar to the MethodCall target functionality?
The text was updated successfully, but these errors were encountered: