Skip to content
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

Support semantic logging #1648

Merged
merged 4 commits into from
Jan 12, 2022
Merged

Support semantic logging #1648

merged 4 commits into from
Jan 12, 2022

Conversation

mregen
Copy link
Contributor

@mregen mregen commented Dec 28, 2021

  • For EventSource and legacy logger refactor logging to support the built in LogValueFormatter, which provides the format strings suitable for string.Format.
  • Breaking change: For TraceEvent this is a breaking change, because there is no implementation yet to support to provide the reformatted format string. With this implementation if a logging framework is used which supports the semantic logging, there is no issue. With frameworks which do not understand semantic logging strings(e.g. log4net) it is a breaking change, string.format will throw exceptions --> move to ILogger hook using SetLogger.
  • Warning: When Microsoft.Extensions.Logger based loggers are used, format strings must follow this convention:
    i) All variable entries must follow order and count up, e.g. "{0} -- {1}" etc., no mix of "{2}--{0}"
    ii) in the same way the args must follow this strict ordering.
  • Format strings will be changed by future PR to include the semantic values.

@mregen mregen marked this pull request as draft December 28, 2021 12:17
@mregen mregen added the tracing label Dec 28, 2021
@mregen mregen added this to the 1.4.368 milestone Dec 28, 2021
@codecov
Copy link

codecov bot commented Dec 28, 2021

Codecov Report

Merging #1648 (4dd2f47) into master (b41fb36) will decrease coverage by 0.12%.
The diff coverage is 36.27%.

❗ Current head 4dd2f47 differs from pull request most recent head f0cbc70. Consider uploading reports for the commit f0cbc70 to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1648      +/-   ##
==========================================
- Coverage   53.76%   53.63%   -0.13%     
==========================================
  Files         319      305      -14     
  Lines       57781    56331    -1450     
==========================================
- Hits        31065    30213     -852     
+ Misses      26716    26118     -598     
Impacted Files Coverage Δ
...ies/Opc.Ua.Server/Server/OpcUaServerEventSource.cs 46.00% <0.00%> (-0.94%) ⬇️
...braries/Opc.Ua.Server/Subscription/Subscription.cs 59.12% <0.00%> (-0.95%) ⬇️
...Security/Certificates/DirectoryCertificateStore.cs 88.53% <0.00%> (ø)
Stack/Opc.Ua.Core/Stack/Tcp/TcpServerChannel.cs 61.11% <0.00%> (ø)
...tack/Opc.Ua.Core/Stack/Tcp/TcpTransportListener.cs 72.62% <0.00%> (-0.39%) ⬇️
Stack/Opc.Ua.Core/Stack/Tcp/UaSCBinaryChannel.cs 67.37% <0.00%> (-0.29%) ⬇️
...k/Opc.Ua.Core/Stack/Tcp/UaSCBinaryClientChannel.cs 64.35% <0.00%> (ø)
.../Opc.Ua.Core/Stack/Types/ContentFilter.Evaluate.cs 29.01% <0.00%> (ø)
Stack/Opc.Ua.Core/Types/BuiltIn/NodeId.cs 64.42% <ø> (ø)
...ck/Opc.Ua.Core/Types/Utils/OpcUaCoreEventSource.cs 30.43% <11.42%> (+10.24%) ⬆️
... and 35 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b41fb36...f0cbc70. Read the comment docs.

@mregen mregen changed the title [WIP] Support semantic logging Support semantic logging Jan 12, 2022
@mregen mregen self-assigned this Jan 12, 2022
@mregen mregen marked this pull request as ready for review January 12, 2022 10:05
@mregen mregen merged commit fa6099b into master Jan 12, 2022
@mregen mregen deleted the semantic_logging branch January 12, 2022 13:51
@koepalex
Copy link
Contributor

👏

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.

None yet

3 participants