-
Notifications
You must be signed in to change notification settings - Fork 95
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use syslog format for logging, add service request scopes to logs #314
Conversation
src/CliOptions.cs
Outdated
@@ -31,11 +32,11 @@ public static Mono.Options.OptionSet InitCommandLineOptions() | |||
} | |||
} | |||
}, | |||
{ "ll|loglevel=", "the loglevel to use (allowed: fatal, error, warn, info, debug, verbose).\nDefault: info", (string s) => { | |||
var logLevels = new List<string> {"fatal", "error", "warn", "info", "debug", "verbose"}; | |||
{ "ll|loglevel=", "the loglevel to use (allowed: critical, warn, info, debug, trace Default: info", (string s) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -182,7 +183,7 @@ private BaseDataVariableState CreateBaseVariable(BaseDataVariableState baseDataV | |||
} | |||
else | |||
{ | |||
Logger.Debug("NodeId type is {nodeIdType}", path.GetType().ToString()); | |||
Logger.LogDebug("NodeId type is {nodeIdType}", (string)path.GetType().ToString()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
otherwise logdebug is unhappy
asyncResult.AsyncState is object[] asyncStateArray && | ||
asyncStateArray[0] is TcpServerChannel channel) | ||
{ | ||
using var scope = Logger.BeginScope("ChannelId:\"{ChannelId}\"", channel.Id); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no, the format goes directly in syslog and there is no space after :
@@ -27,10 +29,15 @@ public static class Program | |||
/// </summary> | |||
public const string ProgramName = "OpcPlc"; | |||
|
|||
/// <summary> | |||
/// | |||
/// </summary> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Summary is empty #Closed
src/OpcApplicationConfiguration.cs
Outdated
|
||
var microsoftLogger = new SerilogLoggerFactory(Logger) | ||
.CreateLogger("OPC"); | ||
var microsoftLogger = Program.LoggerFactory.CreateLogger("Opc"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes
@mregen also, pls increase version in version.json #Resolved |
good catch, this was unintentional... In reply to: 1827222711 Refers to: .editorconfig:1 in 713f9bd. [](commit_id = 713f9bd, deletion_comment = True) |
2.9.14 In reply to: 1827528585 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Purpose
Microsoft.Extensions.Logging.ILogger
-> all log messages changedDoes this introduce a breaking change?
Pull Request Type
What kind of change does this Pull Request introduce?
How to Test
What to Check
Verify that the following are valid
Other Information