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

feature: Selectable logging way #1445

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

xevilmaxx
Copy link

@xevilmaxx xevilmaxx commented Nov 8, 2024

Since there is no way to override Serilog Configuration outside the project, wanted to add a simple workaround.

#1088

Made possible select exactly which type of logging the user needs
By default it uses original way
Yet, its now possible to disable all kinds of undesired sinks (especially files)

Available types (optional parameter):

public enum LoggingDirection
{
    /// <summary>
    /// Will use normal default nuke way of logging configuration
    /// </summary>
    Default,

    /// <summary>
    /// No Logging at all
    /// </summary>
    None,

    /// <summary>
    /// Use Enricher feature
    /// </summary>
    Enricher,

    /// <summary>
    /// Use Host logging
    /// </summary>
    Host,

    /// <summary>
    /// Use Console logging
    /// </summary>
    Console,

    /// <summary>
    /// Use Memory Logging
    /// </summary>
    InMemory,

    /// <summary>
    /// Use Files Logging 
    /// <para/>
    /// (in some scenarios may hurt concurrent instances if they attempt to write on same file, otherwise you need manually create different temp directories)
    /// </summary>
    Files
}

I confirm that the pull-request:

  • Follows the contribution guidelines
  • Is based on my own work
  • Is in compliance with my employer

…larity. With backward compatibility for existent code. Maybe its better do some test before merging to stable release.
@xevilmaxx xevilmaxx changed the title Selectable logging way feature: Selectable logging way Nov 8, 2024
@JvanderStad
Copy link

Heads up! I ran into the same issue and also submitted a PR for it: #1409. However, it wasn't merged because of this response: "Thanks for the suggestion, but at the moment that's not something that appeals to me."

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants