Skip to content

Optimize: use Serilog instead#1013

Open
Wi1l-B0t wants to merge 10 commits intoneo-project:master-n3from
Wi1l-B0t:optimize.use-serilog-instead
Open

Optimize: use Serilog instead#1013
Wi1l-B0t wants to merge 10 commits intoneo-project:master-n3from
Wi1l-B0t:optimize.use-serilog-instead

Conversation

@Wi1l-B0t
Copy link
Contributor

The previous logger is too simple.
So use Serilog instead of it.

@github-actions github-actions bot added the N3 label Mar 13, 2026
@codecov
Copy link

codecov bot commented Mar 13, 2026

Codecov Report

❌ Patch coverage is 44.71545% with 68 lines in your changes missing coverage. Please review.
✅ Project coverage is 47.42%. Comparing base (390a76b) to head (ec792d4).

Files with missing lines Patch % Lines
...DBFTPlugin/Consensus/ConsensusService.OnMessage.cs 42.10% 10 Missing and 12 partials ⚠️
plugins/DBFTPlugin/Consensus/ConsensusService.cs 36.36% 5 Missing and 9 partials ⚠️
plugins/OracleService/OracleService.cs 55.00% 4 Missing and 5 partials ⚠️
...ins/DBFTPlugin/Consensus/ConsensusService.Check.cs 54.54% 2 Missing and 3 partials ⚠️
...s/StateService/Verification/VerificationService.cs 0.00% 5 Missing ⚠️
...ins/OracleService/Protocols/OracleNeoFSProtocol.cs 0.00% 3 Missing ⚠️
plugins/RpcServer/RpcServerPlugin.cs 40.00% 0 Missing and 3 partials ⚠️
...s/StateService/Verification/VerificationContext.cs 0.00% 2 Missing ⚠️
...FTPlugin/Consensus/ConsensusContext.MakePayload.cs 0.00% 0 Missing and 1 partial ⚠️
plugins/DBFTPlugin/Consensus/ConsensusContext.cs 66.66% 1 Missing ⚠️
... and 3 more
Additional details and impacted files
@@              Coverage Diff              @@
##           master-n3    #1013      +/-   ##
=============================================
+ Coverage      43.73%   47.42%   +3.68%     
=============================================
  Files            274      274              
  Lines          15682    15631      -51     
  Branches        1959     2001      +42     
=============================================
+ Hits            6859     7413     +554     
+ Misses          8461     7754     -707     
- Partials         362      464     +102     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Wi1l-B0t Wi1l-B0t force-pushed the optimize.use-serilog-instead branch from 481fe49 to e4d8cc7 Compare March 17, 2026 01:02
Jim8y
Jim8y previously approved these changes Mar 17, 2026
ajara87
ajara87 previously approved these changes Mar 17, 2026
@shargon
Copy link
Member

shargon commented Mar 18, 2026

@superboyiii could you test it?

@shargon shargon requested a review from superboyiii March 18, 2026 10:57
Copy link
Member

@superboyiii superboyiii left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even all active in config.json like:

  "ApplicationConfiguration": {
    "Logger": {
      "Path": "Logs",
      "ConsoleOutput": true,
      "Active": true
    },
    ...

No log shows in console although it's generated in ./Logs/Plugin_DBFTPlugin.

image image

@superboyiii
Copy link
Member

superboyiii commented Mar 19, 2026

All console log is not working... Are we going to cancel console log but just keep local log?

@Wi1l-B0t
Copy link
Contributor Author

Wi1l-B0t commented Mar 19, 2026

All console log is not working... Are we going to cancel console log but just keep local log?

No console log.

Do we really need console log?

@Wi1l-B0t Wi1l-B0t changed the title Optimize: user Serilog instead Optimize: use Serilog instead Mar 19, 2026
@shargon
Copy link
Member

shargon commented Mar 19, 2026

All console log is not working... Are we going to cancel console log but just keep local log?

We should be able to have both

@shargon shargon self-requested a review March 19, 2026 14:52
@Wi1l-B0t
Copy link
Contributor Author

Wi1l-B0t commented Mar 19, 2026

All console log is not working... Are we going to cancel console log but just keep local log?

We should be able to have both

It can been done.
But it will make logging more complicated.

Maybe tail is OK.

@superboyiii
Copy link
Member

superboyiii commented Mar 20, 2026

It can been done. But it will make logging more complicated.

Maybe tail is OK.

Then you should remove console output related option in config. It's there but not working, making people confusing.

@superboyiii
Copy link
Member

superboyiii commented Mar 20, 2026

@Wi1l-B0t I'm very confusing why you think the old log is simple. I haven't seen any improvement in this PR but just turn to Serilog instead. Here’s no configuration visible support for Serilog sinks like JSON, Seq, or Elasticsearch. Console output is removed and no colorful Loglevel anymore. For ordinary users the perceived change in the logs is minimal—possibly even worse if console output has stopped working. Anyway, I'm not against switching to Serilog, it's good. But I need to see any
real improvement so we can say The previous logger is too simple.

@shargon
Copy link
Member

shargon commented Mar 20, 2026

Should be optional, just a bool in config

@Wi1l-B0t
Copy link
Contributor Author

Wi1l-B0t commented Mar 20, 2026

@Wi1l-B0t I'm very confusing why you think the old log is simple. I haven't seen any improvement in this PR but just turn to Serilog instead. Here’s no configuration visible support for Serilog sinks like JSON, Seq, or Elasticsearch. Console output is removed and no colorful Loglevel anymore. For ordinary users the perceived change in the logs is minimal—possibly even worse if console output has stopped working. Anyway, I'm not against switching to Serilog, it's good. But I need to see any real improvement so we can say The previous logger is too simple.

?
Why no improvement ?
The previous implementation opens file, close file each log, and creates log instance even if log is disabled.

This is a naive and inefficient way.

@Wi1l-B0t
Copy link
Contributor Author

Wi1l-B0t commented Mar 20, 2026

@Wi1l-B0t I'm very confusing why you think the old log is simple. I haven't seen any improvement in this PR but just turn to Serilog instead. Here’s no configuration visible support for Serilog sinks like JSON, Seq, or Elasticsearch. Console output is removed and no colorful Loglevel anymore. For ordinary users the perceived change in the logs is minimal—possibly even worse if console output has stopped working. Anyway, I'm not against switching to Serilog, it's good. But I need to see any real improvement so we can say The previous logger is too simple.

OK.

I will create an update to support the use of different sinks.

@Wi1l-B0t
Copy link
Contributor Author

@Wi1l-B0t I'm very confusing why you think the old log is simple. I haven't seen any improvement in this PR but just turn to Serilog instead. Here’s no configuration visible support for Serilog sinks like JSON, Seq, or Elasticsearch. Console output is removed and no colorful Loglevel anymore. For ordinary users the perceived change in the logs is minimal—possibly even worse if console output has stopped working. Anyway, I'm not against switching to Serilog, it's good. But I need to see any real improvement so we can say The previous logger is too simple.

neo-project/neo#4513

@ajara87
Copy link
Member

ajara87 commented Mar 20, 2026

I don’t see value in keeping two logging systems. Having both would only duplicate configuration and increase maintenance while Serilog already provides structured logging and better extensibility

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants