Git Product home page Git Product logo

akka.logger.nlog's People

Contributors

aaronontheweb avatar alexvaluyskiy avatar arkatufus avatar bkreminski-moldev avatar danthar avatar dependabot-preview[bot] avatar dependabot[bot] avatar heynickc avatar horusiath avatar irperez avatar jannicklange avatar maxim-s avatar patrickmcdonald avatar sean-gilliam avatar snakefoot avatar x2764tech avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

akka.logger.nlog's Issues

FullName as Logger Name looks weird

Curious why NLog is using the following as Logger-name:

https://github.com/AkkaNetContrib/Akka.Logger.NLog/blob/538224ca1fd62b22e18242827b752a997e3128d3/src/Akka.Logger.NLog/NLogLogger.cs#L30

It seems to give funny output:

Akkling.Actors+FunActor1[[System.String, System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]]`

akkadotnet/akka.net#3428 (comment)

Can see that Serilog uses a different logger-name (Context.Sender.Path) and ignores LogClass:

https://github.com/akkadotnet/Akka.Logger.Serilog/blob/dev/src/Akka.Logger.Serilog/SerilogLogger.cs#L40

Can see that log4net NetCore skips FullName and just uses (logEvent.LogClass):

https://github.com/AkkaNetContrib/Akka.Logger.log4net/blob/d9b6d7d48a7b45dfcfa68bc92cb19993e595de79/src/Akka.Logger.log4net/Log4NetLogger.cs#L30

What is the correct way to capture context-location-name (aka logger-name) ? It looks like the official way is logEvent.LogSource:

https://github.com/akkadotnet/Akka.Logger.Serilog/blob/dcbfdc5ecec29cf2d4aa4b9ead87f22d4252dff1/src/Akka.Logger.Serilog/SerilogLogger.cs#L40

Not able to log to sql server database with net core2.0 console application

Hi,
I am trying to log to sql server database without success. Though I am able to log to file as well on console.
ENVIRONMENT: .NET CORE 2.0
APPLICATION TYPE: .Net Console

The code goes:

using Akka.Actor;
using Akka.Event;
using Akka.Configuration;
using System;

namespace LogApp
{
    class Program
    {
        static void Main(string[] args)
        {
            Config config = ConfigurationFactory.ParseString(@"
akka { 
    loglevel = INFO
    loggers=[""Akka.Logger.NLog.NLogLogger, Akka.Logger.NLog""]
    actor {
        debug
            {
              receive = on      # log any received message
              autoreceive = on  # log automatically received messages, e.g. PoisonPill
              lifecycle = on    # log actor lifecycle changes
              event-stream = on # log subscription changes for Akka.NET event stream
              unhandled = on    # log unhandled messages sent to actors
            }
    }
}
");
            var actorSystem = ActorSystem.Create("MyActorSystem", config);
            var actor = actorSystem.ActorOf(Props.Create<LoggingActor>(), "loggingActor");
            actor.Tell( "HELLO" );
            Console.ReadLine();
        }
    }
    public class LoggingActor : ReceiveActor, ILogReceive
    {
        private readonly ILoggingAdapter logger = Logging.GetLogger(Context);
        public LoggingActor()
        {
            Receive<string>(s => logger.Info(s));
        }
    }
}

and the nlog.config is:

<?xml version="1.0" encoding="utf-8" ?>
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <targets>
  <target name="file" xsi:type="File" fileName="Log.log" />
  <target name="db" xsi:type="Database" >
      <dbProvider>sqlserver</dbProvider>
      <connectionString>data source=D-SYD01STD02;initial catalog=QBTData;persist security info=True;user id=QBTApps;password=T1cketing!;MultipleActiveResultSets=True;</connectionString>
      <commandText>
        insert into dbo.TQMLog (Application, Message) values ( 'TQM', 'newTest123');
      </commandText>
    </target>
  </targets>
  <rules>
    <logger name="*" minlevel="Info" writeTo="file,db" />
  </rules>
</nlog>

Attached are 2 related files
LogApp.zip
Please advise.

.NET Core usage

Might need to take a look at the actual usage of the plugin on .NET Core. Tried to enable it in https://github.com/petabridge/lighthouse .NET Core version (with configuration the same as in the .NET 4.5 version of Lighthouse) and wasn't seeing any console output.

Need to configure CI

I introduced the new build system, and created pipeline definitions.
But i don't have project level authorizations to configure the hooks and PR validation steps.
@Aaronontheweb can you fix that for me ? (auth or hooks config, i don't care)

NLog removed packages >= 5.0.0-betaXX from NuGet

NLog 5.0.0-XX was removed from NuGet, as it was "Nlog 5 is working, but it's not good enough".
See NLog/NLog#2457

I created a PR that targets NLog 4.5.0-rc06:
#28

It'd be appreciated if you could release a new version of Akka.Logger.NLog soon, since I'd really like to keep using it in my project :)

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.