Skip to content
This repository has been archived by the owner on Feb 27, 2022. It is now read-only.

Made changes to allow passing number of frames to be skipped for calc… #8

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

sonaljain14
Copy link

…ulation of caller class name, method name and line number. This is to allow proper working with log4net conversion template %C(%M),%line which without this change would return the Log4NetSink(Emit), 0

…ulation of caller class name, method name and line number. This is to allow proper working with log4net conversion template %C(%M),%line which without this change would return the Log4NetSink(Emit), 0
@nblumhardt
Copy link
Contributor

Thanks for the PR! 👍

Definitely in favor of making the behavioral change, but do we need to expose the skipFrames option as a configuration parameter? It seems like a custom wrapper over Serilog over log4net is a fairly narrow use case. If we leave the WriteTo.Log4Net() method signature unchanged, we don't need to worry about how to deal with a binary (API) breaking change. What do you think?

@sonaljain14
Copy link
Author

Thanks for looking into the PR. We actually came across this scenario in one of our projects. We were developing libraries wherein we have a wrapper over serilog. All the new code we write is going to use serilog along with seq. For a few of the assemblies that we are making we need to give them to a team which has to be integrated into a legacy product which is using log4net (again with a wrapper). for that specific reason I thought of passing the skipFrames as a parameter.

@nblumhardt
Copy link
Contributor

Thanks for the follow-up; I just had a deeper look into this - I think the dynamic stack frame construction and reflection are going to be a pretty big per-event performance hit.

Would it work to specify callerStackBoundaryDeclaringType directly on WriteTo.Log4Net()? (For Serilog, this would be Logger).

@sonaljain14 sonaljain14 reopened this Mar 13, 2019
dependabot bot and others added 5 commits September 30, 2021 14:40
Bumps [log4net](https://github.com/apache/logging-log4net) from 2.0.5 to 2.0.10.
- [Release notes](https://github.com/apache/logging-log4net/releases)
- [Changelog](https://github.com/apache/logging-log4net/blob/master/ReleaseInstructions.txt)
- [Commits](https://github.com/apache/logging-log4net/commits/rel/2.0.10)

---
updated-dependencies:
- dependency-name: log4net
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>
Bumps [log4net](https://github.com/apache/logging-log4net) from 2.0.5 to 2.0.10.
- [Release notes](https://github.com/apache/logging-log4net/releases)
- [Changelog](https://github.com/apache/logging-log4net/blob/master/ReleaseInstructions.txt)
- [Commits](https://github.com/apache/logging-log4net/commits/rel/2.0.10)

---
updated-dependencies:
- dependency-name: log4net
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>
…inks.Log4Net/log4net-2.0.10

Bump log4net from 2.0.5 to 2.0.10 in /src/Serilog.Sinks.Log4Net
…g.Sinks.Log4Net.Sample/log4net-2.0.10

Bump log4net from 2.0.5 to 2.0.10 in /Sample/Serilog.Sinks.Log4Net.Sample
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants