Git Product home page Git Product logo

rocklib.logging's People

Contributors

aydinakcasu avatar aydinakcasuatquickenloans avatar bencrim avatar bfriesen avatar chrisferrantelli avatar derikwhittaker avatar eslutz avatar greaterthanmost avatar jakebeebe avatar jasonbock avatar javery2 avatar jjmckain avatar jkrmo avatar justinmoss avatar kristycurrier avatar mdubbs avatar mjeaton avatar motionsuggests avatar neilschiefer avatar tgerchow avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rocklib.logging's Issues

Rock.Framework.Logging

In the open source rock framework the logger is not fully functional. It's working for windows apps, console apps but it seems to be not logging anything for web apps. More particularly the log provider that's failing is HttpEndPointLogProvider.

NET6.0

With 4.6.1 already EOL and unsupported is there a plan to upgrade this library to NET6.0 or create a new one leveraging the new framework?

If so, is there an ETA?

Finish 2.x Documentation - Review Documentation

Review documentation that is currently in process:

  • ASPNETCore.md
    • Make edits based on the review
  • ContextProviders.md
    • Make edits based on the review
  • LogProcessor.md
    • Make edits based on the review

LoggerFactory.GetInstance does not return a new instance of the logger

From what I can see in your implementation, when I call for an instance of a logger for the first time, it creates that instance but subsequent calls are pulled from the dictionary. I do not see any checks that the instance is still valid and in an application with per scope/per instance dependency injection, that instance will get disposed of at the end of the call to it.

Include ThreadID in the extended properties of a LogEntry by default

This specific request is to include ThreadID as a default extended property, but it could expand to other default data points as well. I'm not sure what those would be, but i'm sure a list could be put together including potentially beneficial inclusions.

ThreadID, specifically, could be very helpful when logging using multi-threaded applications. The only potential downside I could see is that you could argue it's inclusion could bloat log messages, but I also think that ThreadID is one of those datapoints that's not helpful if you don't need it, but it's absence can cause some big confusion if you do need it.

LoggerLookupRegistration fails if you have multiple instances of ILogger registered

isSingletonLoggers is assigned at the time of calling "AddLogger". This fails when the count of ILogger instances does not match on execution of the LoggerLookupRegistration due to access of the index here: !isSingletonLoggers[i].

It is common using the WebApplicationFactory from the ASP.NET Testing Framework to inject your own mock instance into the service container. This leads to 2 ILoggers existing in the service container and this hard to debug exception being thrown:

System.IndexOutOfRangeException : Index was outside the bounds of the array.
   at RockLib.Logging.DependencyInjection.ServiceCollectionExtensions.<>c__DisplayClass7_1.<SetLoggerLookupDescriptor>b__3(String name)
   at RockLib.Logging.RockLibLoggerProviderExtensions.<>c__DisplayClass3_0.<AddRockLibLoggerProvider>b__0(IServiceProvider serviceProvider) in /_/RockLib.Logging.Microsoft.Extensions/RockLibLoggerProviderExtensions.cs:line 82

https://github.com/RockLib/RockLib.Logging/blob/main/RockLib.Logging/DependencyInjection/ServiceCollectionExtensions.cs#L207

        // Capture which loggers are singleton according to index.
        var isSingletonLoggers = services.Where(service => service.ServiceType == typeof(ILogger))
            .Select(service => service.Lifetime == ServiceLifetime.Singleton)
            .ToArray();

        LoggerLookup LoggerLookupRegistration(IServiceProvider serviceProvider) => name =>
        {
            // Select the first logger that has a matching name.
            var loggers = serviceProvider.GetServices<ILogger>().ToArray();
            var selectedLogger = loggers.First(logger => NamesEqual(logger.Name, name));

            // Immediately dispose any non-singleton loggers that weren't selected.
            for (var i = 0; i < loggers.Length; i++)
            {
                if (!isSingletonLoggers[i] && !ReferenceEquals(loggers[i], selectedLogger))
                {
                    loggers[i].Dispose();
                }
            }

            return selectedLogger;
        };

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.