Code Monkey home page Code Monkey logo

serilog.sinks.buffer's People

Contributors

dsschneidermann avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

serilog.sinks.buffer's Issues

Dependabot couldn't find a <anything>.(cs|vb|fs)proj for this project

Dependabot couldn't find a .(cs|vb|fs)proj for this project.

Dependabot requires a .(cs|vb|fs)proj to evaluate your project's current .NET dependencies. It had expected to find one at the path: /src/<anything>.(cs|vb|fs)proj.

If this isn't a .NET project, or if it is a library, you may wish to disable updates for it from within Dependabot.

You can mention @dependabot in the comments below to contact the Dependabot team.

BufferCapacity - Doesnt take the 'last' n entries

Thanks for creating this sink! It is a very useful addition.

Came across this issue :
To create a new bag with half the items , following code is used in LogBuffer.cs
Bag = new ConcurrentBag<LogEvent>(logEvents.Take(Math.Max(1, config.BufferCapacity / 2)));

This uses "Take" which retrieves first 'n' elements (based on buffer capacity).

Consider the scenario:

  • BufferCapacity to 15
  • buffer all Debug messages (Say message 1 to message 19)
  • an error event happens after all the above debug messages

Issue: While Creating / PruningLogEntries : Instead of fetching last "n" entries from buffer , first "n" entries are fetched , which makes the log messages not sequential

Log message looks like:
2022-12-28 04:05:44.599|[ERR]|This is a trigger|
2022-12-28 04:05:44.596|[DBG]||Message Line number 0
2022-12-28 04:05:44.596|[DBG]|Message Line number 1
2022-12-28 04:05:44.596|[DBG]|Message Line number 2
2022-12-28 04:05:44.596|[DBG]|Message Line number 3
2022-12-28 04:05:44.596|[DBG]|Message Line number 4
2022-12-28 04:05:44.596|[DBG]|Message Line number 5
2022-12-28 04:05:44.599|[DBG]|Message Line number 15
2022-12-28 04:05:44.599|[DBG]|Message Line number 16
2022-12-28 04:05:44.599|[DBG]|Message Line number 17
2022-12-28 04:05:44.599|[DBG]|Message Line number 18
2022-12-28 04:05:44.599|[DBG]|Message Line number 19

Solution : use "TakeLast " to retrieve last "n" messages

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.