You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Integrate ConsoleLogExporter functionality from dotnet/extensions #87250
@geeknoid can you please add more details about bringing these to the runtime? I am seeing these are currently internal in the extension's repo. Why can't these stay there? Thanks!
Sorry for the late follow-up. The differences between what we have in dotnet/extensions vs. what's already in the platform is reflected through the options, which I pasted below. The dotnet/extesnions design was created to provide a first class experience for developers using the console in every day work. But in brief:
Support for outputting log entry dimensions
Control over which parts of log messages to output (IncludeLogLevel, IncludeTimeStamp, IncludeCategory, IncludeSpanId, IncludeTraceId, IncludeDimensions, IncludeExceptionStackTrace)
Control over color output (the *Color properties).
publicclassLoggingConsoleOptions{/// <summary>/// Gets or sets a value indicating whether to display scopes./// </summary>/// <value>/// Defaults to <see langword="true"/>./// </value>publicboolIncludeScopes{get;set;}=true;/// <summary>/// Gets or sets the format string used to format timestamps in logging messages./// </summary>/// <value>/// Defaults to <c>yyyy-MM-dd HH:mm:ss.fff</c>./// </value>publicstring?TimestampFormat{get;set;}="yyyy-MM-dd HH:mm:ss.fff";/// <summary>/// Gets or sets a value indicating whether or not UTC timezone should be used for timestamps in logging messages./// </summary>/// <value>/// Defaults to <see langword="false"/>./// </value>publicboolUseUtcTimestamp{get;set;}/// <summary>/// Gets or sets a value indicating whether to display the timestamp./// </summary>/// <value>/// Defaults to <see langword="true"/>./// </value>publicboolIncludeTimestamp{get;set;}=true;/// <summary>/// Gets or sets a value indicating whether to display the log level./// </summary>/// <value>/// Defaults to <see langword="true"/>./// </value>publicboolIncludeLogLevel{get;set;}=true;/// <summary>/// Gets or sets a value indicating whether to display the category./// </summary>/// <value>/// Defaults to <see langword="true"/>./// </value>publicboolIncludeCategory{get;set;}=true;/// <summary>/// Gets or sets a value indicating whether to display the stack trace./// </summary>/// <value>/// Defaults to <see langword="true"/>./// </value>publicboolIncludeExceptionStacktrace{get;set;}=true;/// <summary>/// Gets or sets a value indicating whether to display the activity TraceId./// </summary>/// <value>/// The default value is <see langword="true"/>./// </value>publicboolIncludeTraceId{get;set;}=true;/// <summary>/// Gets or sets a value indicating whether to display the activity SpanId./// </summary>/// <value>/// The default value is <see langword="true"/>./// </value>publicboolIncludeSpanId{get;set;}=true;/// <summary>/// Gets or sets a value indicating whether colors are enabled or not./// </summary>/// <value>/// Defaults to <see langword="true"/>./// </value>publicboolColorsEnabled{get;set;}=true;/// <summary>/// Gets or sets the color to use for dimmed text./// </summary>/// <value>Defaults to <see cref="ConsoleColor.DarkGray"/>.</value>publicConsoleColorDimmedColor{get;set;}=ConsoleColor.DarkGray;/// <summary>/// Gets or sets the color to use for dimmed text background./// </summary>publicConsoleColor?DimmedBackgroundColor{get;set;}/// <summary>/// Gets or sets the color to use for exception text./// </summary>/// <value>Defaults to <see cref="ConsoleColor.Red"/>.</value>publicConsoleColorExceptionColor{get;set;}=ConsoleColor.Red;/// <summary>/// Gets or sets the color to use for exception text background./// </summary>publicConsoleColor?ExceptionBackgroundColor{get;set;}/// <summary>/// Gets or sets the color to use for exception stack trace text./// </summary>/// <value>Defaults to <see cref="ConsoleColor.DarkRed"/>.</value>publicConsoleColorExceptionStackTraceColor{get;set;}=ConsoleColor.DarkRed;/// <summary>/// Gets or sets the color to use for exception stack trace text background./// </summary>publicConsoleColor?ExceptionStackTraceBackgroundColor{get;set;}/// <summary>/// Gets or sets a value indicating whether to include dimension name/value pairs with each log record./// </summary>/// <value>Defaults to <see langword="false"/>.</value>publicboolIncludeDimensions{get;set;}/// <summary>/// Gets or sets the color to use for dimension text./// </summary>/// <value>Defaults to <see cref="ConsoleColor.DarkGreen"/>.</value>publicConsoleColorDimensionsColor{get;set;}=ConsoleColor.DarkGreen;/// <summary>/// Gets or sets the color to use for dimension text background./// </summary>publicConsoleColor?DimensionsBackgroundColor{get;set;}}
Note that the console logging feature from dotnet/extensions is being removed as of this PR: dotnet/extensions#4076. This is to eliminate redundancy, so we don't have N console loggers floating around.
When it comes time to implement this functionality, please go dig into the history of the extensions repo for reference.
@joperezr This is the item I mentioned would be important to do in support of structured logging. Otherwise, an app using structured logging sees nothing coming out on the console during development.
Triage: The package seems working all fine in dotnet/extensions, we might have missed something, however, we don't see a strong reason to move it to dotnet/runtime. It's true we now have multiple implementations but we will have to keep supporting the dotnet/extensions version anyway now.
Activity
tarekgh commentedon Jun 8, 2023
@geeknoid can you please add more details about bringing these to the runtime? I am seeing these are currently internal in the extension's repo. Why can't these stay there? Thanks!
geeknoid commentedon Jun 8, 2023
It's public. Here are the options: https://github.com/dotnet/extensions/pull/4017/files#diff-fc1e1bc2b0ec5f224700c054d81993fb7b35367bd5ff65d265a444aa57a78982.
I'll do a more detailed comparison tonight.
geeknoid commentedon Jun 13, 2023
Sorry for the late follow-up. The differences between what we have in dotnet/extensions vs. what's already in the platform is reflected through the options, which I pasted below. The dotnet/extesnions design was created to provide a first class experience for developers using the console in every day work. But in brief:
Support for outputting log entry dimensions
Control over which parts of log messages to output (IncludeLogLevel, IncludeTimeStamp, IncludeCategory, IncludeSpanId, IncludeTraceId, IncludeDimensions, IncludeExceptionStackTrace)
Control over color output (the *Color properties).
tarekgh commentedon Jun 13, 2023
Edited
I think you meantConsoleFormatterOptionsand notLoggingConsoleOptions.For trace/span ids we already have ActivityTrackingOptionsnoahfalk commentedon Jun 13, 2023
https://github.com/dotnet/extensions/blob/6e1d1c0e48dbc62d861f1ad2b631ecc42c3957ae/src/Libraries/Microsoft.Extensions.Telemetry.Console/Logging/LoggingConsoleOptions.cs#L14
geeknoid commentedon Jun 14, 2023
Note that the console logging feature from dotnet/extensions is being removed as of this PR: dotnet/extensions#4076. This is to eliminate redundancy, so we don't have N console loggers floating around.
When it comes time to implement this functionality, please go dig into the history of the extensions repo for reference.
geeknoid commentedon Dec 21, 2023
@joperezr This is the item I mentioned would be important to do in support of structured logging. Otherwise, an app using structured logging sees nothing coming out on the console during development.
rosebyte commentedon Feb 10, 2026
Triage: The package seems working all fine in dotnet/extensions, we might have missed something, however, we don't see a strong reason to move it to dotnet/runtime. It's true we now have multiple implementations but we will have to keep supporting the dotnet/extensions version anyway now.