Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 06:04

    serilog-build on v68

    (compare)

  • 06:03

    nblumhardt on dev

    Dev version bump [skip ci] (compare)

  • 06:03

    nblumhardt on main

    Dev version bump [skip ci] Note that UDFs can accept `LogE… Concat(s0, s1, ..sN) and 17 more (compare)

  • 05:40

    nblumhardt on dev

    Update publishing key (compare)

  • 02:34

    nblumhardt on dev

    New features, minor version bump (compare)

  • 02:33

    nblumhardt on dev

    Use method argument names and o… Merge pull request #49 from nbl… (compare)

  • 02:10

    QuantumNightmare on dev

    Changed property name to avoid … Merge pull request #38 from Qua… (compare)

  • 01:37

    QuantumNightmare on dev

    Fix stacktrace when no exceptio… Strip Serilog classes from the … Merge pull request #37 from Qua… (compare)

  • 00:00

    nblumhardt on dev

    Add nullable for ilogger and im… (compare)

  • Jun 20 23:10

    nblumhardt on dev

    make TestDummies use nullable Update DummyConsoleSink.cs (compare)

  • Jun 20 22:56

    nblumhardt on dev

    remove redundant nullable remove some usings move perf tests to net 5 and 3 more (compare)

  • Jun 20 22:53

    nblumhardt on dev

    share common csproj settings Update serilog-expressions.sln Merge pull request #46 from Sim… (compare)

  • Jun 20 22:51

    nblumhardt on dev

    use Nullable packages instead o… Merge pull request #47 from Sim… (compare)

  • Jun 15 22:50

    nblumhardt on dev

    Concat(s0, s1, ..sN) Simplify description in README Merge pull request #45 from nbl… (compare)

  • Jun 15 06:17

    nblumhardt on dev

    Publishing key update (compare)

  • Jun 15 04:31

    nblumhardt on dev

    make MethodOverloadConventionTe… (compare)

  • Jun 15 04:28

    nblumhardt on dev

    use nullable in Serilog.Perform… (compare)

  • Jun 11 20:15

    nblumhardt on dev

    Remove unnecessary dependencies Merge pull request #222 from bd… (compare)

  • Jun 09 11:39

    nblumhardt on dev

    Note that UDFs can accept `LogE… (compare)

  • Jun 04 22:00

    nblumhardt on dev

    And again... (compare)

Thomas Ardal
@ThomasArdal
Hi. Can someone help with a new NuGet API key for the serilog-sinks-elmahio project? https://github.com/serilog/serilog-sinks-elmahio It expired around 5 months ago, why I don't understand why it expires again this soon? Maybe the previous one had a short expiration set? If I remember correctly, it is possible to set up to 12 months.
8 replies
apondu
@apondu
Hi.. i am trying to integrate Serilog with windows application built on VB.Net framework 4.5.. i am unable to log the the details to Database using sink file.. can someone help me with an example on how to do it..
Nicholas Blumhardt
@nblumhardt
Hi @apondu - posting a question to Stack Overflow under the serilog tag, showing what you have tried and what error is raised (if any) will be the quickest way to solve this one. The "Debugging and Diagnostics" page on the Serilog wiki also has some pointers. HTH!
bdovaz
@bdovaz
bdovaz
@bdovaz

@nblumhardt can you also publish the following packages as stable versions?

3.0.2:

https://www.nuget.org/packages/Serilog.Extensions.Logging/

1.1.1:

https://www.nuget.org/packages/Serilog.Formatting.Compact/

3.2.0:

https://www.nuget.org/packages/Serilog.Enrichers.Thread/

3.2.0:

https://www.nuget.org/packages/Serilog.Settings.Configuration/

Unity game engine can't consume packages from nuget that are not stable with this library:

https://github.com/xoofx/UnityNuGet

Bryan Watts
@bwatts
hello Serilog people! I encountered some unexpected behavior and wrote up a question, if anyone can offer assistance. Thanks! https://stackoverflow.com/questions/67538451/destructure-bytransformingsystem-type-does-not-appear-to-take-effect
Nicholas Blumhardt
@nblumhardt
Had a shot at answering, @bwatts - HTH!
Sorry @bdovaz , will get onto releasing those packages this week, if all goes well :+1:
bdovaz
@bdovaz
Ok, no problem, thanks!
Bryan Watts
@bwatts
thanks @nblumhardt for helping me figure out that question - much appreciated!
takeshelter
@sheltertake
Hi, this morning I did a little analysis/benchmark about the cost of logging. We have legacy APIs in dotnet framework that log too much and append the log in sqlserver. The benchmark results I did obviously show us that logging in sqlserver is completely stupid. We knew but we never invest time to remove this "appender" replacing it with a more performant one.
In order to have a baseline I created a new empty api in dotnet5. I added serilog and I setup 2 endpoints. /healthcheck and let me say /books where books are retrieved from a sqlserver database.
In my poor laptop the healthcheck endpoint return 11303 requests per second without any serilog sinks
This number decrease to 309 requests per second with console (windows if matter, I don't know if console in windows is slow) sink
takeshelter
@sheltertake
I added only UseSerilogRequestLogging
this disproportion does not seem too much to you? 11303 vs 309?
takeshelter
@sheltertake
In the second endpoint, where I query database with dapper and I return about 800 items the proportion is very different. so maybe I answer myself :)
42 request per second vs 38 request per second.
Nicholas Blumhardt
@nblumhardt
@sheltertake console logging is very slow - often a bottleneck (especially interactively, on Windows). Writes are slow, and they're serialized internally by the console sink and by the console infrastructure itself, so they block each other, too
usingsystem007
@usingsystem007
How to apply pretty indent in Serilog.Formatting.Json?
Lonli-Lokli
@Lonli-Lokli
Hi all, I have .net core integration tests with serilog and they run about 2sec each. Accoring to profiling itd because of Serilog.Sinks.Async.BackgroundWorkerSink.Pump() - how can I decrease this time?
3 replies
Ilya Shvetsov
@shvez
Hi, there. I was quite long time using log4net. Recently using benchmarkNet lib I did some perf tests log4net vs nlog vs serilog and was impressed by speed of serilog. Now I'm trying to understand how to configure serilog using file and overwhelmed a little.
so, may be some saw good tutorial log4net to seriglog transition where I can read how to convert loggers and appenders configuration to what serilog understands. So, that I can switch LogLevel on the fly. how to attach sinks to loggers and so on
Ilya Shvetsov
@shvez
I managed to find how to replace log4net.GlobalContext properties and log4net.ThreadContext properties with what serilog provides, but configuration makes me nervous. I also have to admit that we do not use M.E.L
Hans
@Hans92986602_twitter

Hi, I'm using serilog in my project for the first time.

I have a thread that continuously polls a hw device for status and logs the result.

I've created the following logger configuration, but after a few seconds the log file is no longer updated while logging in the debug continues?

Any ideas why?

        Log.Logger = new LoggerConfiguration()
            .Enrich.WithThreadName()
            .MinimumLevel.Information()
            .WriteTo.Debug(
                outputTemplate: "[{Timestamp:HH:mm:ss.fff} {Level:u3}] {ThreadName}: {Message:lj}{NewLine}{Exception}"
                )
            .WriteTo.File(
                @"log.txt", 
                outputTemplate: "[{Timestamp:HH:mm:ss.fff} {Level:u3}] {ThreadName}: {Message:lj}{NewLine}{Exception}", 
                rollingInterval: RollingInterval.Day,
                flushToDiskInterval: TimeSpan.FromSeconds(1)
                )
            .CreateLogger();
orhunerdem
@orhunerdemm_twitter
Hi, is there any guideline for AWS Elasticsearch authentication when internal user database is open and requires to login with basic credentials?
               .WriteTo.Elasticsearch(new ElasticsearchSinkOptions(new Uri("es_url"))
                {
                    ModifyConnectionSettings = settings =>
                    {
                        var httpConnection = new AwsHttpConnection(
                            new BasicAWSCredentials("access_key", "secret_key"),
                            RegionEndpoint.EUCentral1);

                        var pool = new SingleNodeConnectionPool(new Uri("es_url"));
                        var conf = new ConnectionConfiguration(pool, httpConnection);

                        conf.BasicAuthentication("username", "password");
                        return conf;
                    },
}
I couldn't manage to make it work this setup, any help will be appreciated, thank you
Surya V
@surya492:matrix.org
[m]
hi, I'm using serilog for my .net core web api2.1 project. everything is working as expected in local but if i publish the code and if i create two endpoints which are pointing to same published code then serilog is creating two different logs for two endpoints but i would like to maintain in one single log file.could you please help me with this?
surya492
@surya492
hi, I'm using serilog for my .net core web api2.1 project. everything is working as expected in local but if i publish the code and if i create two endpoints which are pointing to same published code then serilog is creating two different logs for two endpoints but i would like to maintain in one single log file.could you please help me with this?
Ruben Bartelink
@bartelink
@surya492 Best to provide some more details on stackoverflow if you need a quick answer
1 reply
Ruben Bartelink
@bartelink
@surya492:matrix.org Added some follow-up questions - I have no particular insights to offer unfortunately, but you've got a question and a link so hopefully a little more context and/or better intuition may help...
surya492
@surya492
i have added comment
2 replies
Surya V
@surya492:matrix.org
[m]
i applied "shared" : true configuration to serilog config. after this only one endpoint logs are inserting and other endpoints logs are not inserting. the endpoint which is hitting at first in the browser those logs are inserting
Ruben Bartelink
@bartelink
That sort of context is best edited into the question - I am only one person that has not spent much time debugging this sort of thing and there is literally nobody else in this room, sorry :(
Jordy van Eijk
@jordyvaneijk
Hi all, I Have a question about the SourceContext when using ILogger<Repository<T>>
at the time i use the generic logger it will only show Repository as sourcecontext but i also want to see what type T is, is there any way to get this working
Andrey G.
@Andrey2G
Hi! I'm encountered into the issues with a lot of failures of sending logs to Elasticsearch. I had not this problem before (upgrading ELK? still not sure). And not sure that I have a problem with Serilog. So, at the moment I have a test server on AWS (t3.2xlarge - 8vCPU+32Gb RAM) with ELK 7.12.1 on it (no cluster, just one node), and when my services are running and sending logs to elasticsearch - a lot of logs handled by FailureCallback and what can I do is only write them to file (without possibility to repeat sending somehow to elasticsearch several times)
What may cause this problem? If I use Serilog.Debugging.SelfLog.Enable may it help to find the problem. Maybe there is a problem with Elasticsearch configuration settings? Do you have any suggestions in what direction should I digging? Thanks in advance!
Andrey G.
@Andrey2G
Interesting, seems like Serilog.Debugging.SelfLog.Enable did help me! I can see a lot of issues, such as "Limit of total fields [1000] has been exceeded" Thanks a lot! :)
ceemafour
@ceemafour
Hi All, I’ve been writing logs to Azure Blob using the AzureBlobStorage sink, but they seem to be writing sequentially as the statements appear in code.
Ive tried all sorts of combinations of arguments to get the batching to work, but it doesnt seem to affect. All logs are serially being processed. This causes a huge hit to performance as some key methods have lots of logs. Any ideas where I could be going wrong ?
Nicholas Blumhardt
@nblumhardt
@ceemafour seems like there's an additional writeInBatches arg for that sink (I'm not familiar with it) if you're setting this to true already, might be one that needs a full write-up showing your configuration, package versions etc. (good candidate for an SO post)
Thomas Ardal
@ThomasArdal
@nblumhardt Hey. I received an invitation to the serilog-contrib organization and thinking about moving the Serilog.Sinks.ElmahIo there. I'm still considering moving this sink to our own organization entirely, which would need a rename like Elmah.Io.Serilog. What are your thoughts about the future of external sinks? Would you like to keep them within the Serilog.Sinks. prefix to make them easy to find on NuGet or do you recommend to move them out entirely? Also, if I move the sink to the contrib org, I see that I would have admin rights on the project. I guess this would make it much easier to move to GitHub Actions, generate my own NuGet API keys, etc., right?
bdovaz
@bdovaz

@nblumhardt I comment again a month later (you said you were going to publish it but I don't know if there have been any problems along the way). Can you also publish the following packages as stable versions?

3.0.2:

https://www.nuget.org/packages/Serilog.Extensions.Logging/

1.1.1:

https://www.nuget.org/packages/Serilog.Formatting.Compact/

3.2.0:

https://www.nuget.org/packages/Serilog.Enrichers.Thread/

3.2.0:

https://www.nuget.org/packages/Serilog.Settings.Configuration/

Unity game engine can't consume packages from nuget that are not stable with this library:

https://github.com/xoofx/UnityNuGet

Thanks!!!

gaazkam
@gaazkam
Hello, I have a question if I might
I know that only ancient serilog versions work on ASP.NET Framework - if I wish to use newer Serilog versions I need to use ASP.NET Core
But what about non-server applications?
Does Serilog support .NET Framework on other applications, such as a Windows service, and for how long?
Unfortunately I'm still stuck at .NET Framework due to third party library compatibility issues :(
This third party library wishes to move to Core eventually, but... they expect this is going to happen within two years :(
Sunil Chandra
@Neeil_93_twitter
Hello, I wanted modify a property before its logged.
is that possible using enrichers ?
Is there any alternate way to do this ?
entropical
@entropical:matrix.org
[m]
Hello all,
I am using Serilog in my .net 5 app along side with Microsoft.Extensions.Logging so to make use of things like ILogger<Controller> logger as dependency injected by the framework.
My configuration works as expected when running under Kestrel, however when I host under IIS I loose the logging capability that comes through the Microsoft.Extensions.Logging as if IIS is somehow hijacking this logging pipeline.
The only way to achieve logging is through the static Log object.
Is this a known problem or something others have run into?
entropical
@entropical:matrix.org
[m]
I just wonder if I could be missing a step specific to IIS when configuring Serilog to play nice with Microsoft.Extensions.Logging