Click here to Skip to main content
15,887,083 members
Home / Discussions / Design and Architecture
   

Design and Architecture

 
GeneralRe: user data system for a web-based e-mail service Pin
Eddy Vluggen18-Jan-24 16:53
professionalEddy Vluggen18-Jan-24 16:53 
GeneralRe: user data system for a web-based e-mail service Pin
Richard Andrew x6419-Jan-24 12:06
professionalRichard Andrew x6419-Jan-24 12:06 
GeneralRe: user data system for a web-based e-mail service Pin
Gerry Schmitz19-Jan-24 13:24
mveGerry Schmitz19-Jan-24 13:24 
GeneralRe: user data system for a web-based e-mail service Pin
trønderen19-Jan-24 14:31
trønderen19-Jan-24 14:31 
PraiseRe: user data system for a web-based e-mail service Pin
Eddy Vluggen10-Feb-24 10:12
professionalEddy Vluggen10-Feb-24 10:12 
AnswerRe: user data system for a web-based e-mail service Pin
Richard Deeming29-Jan-24 4:03
mveRichard Deeming29-Jan-24 4:03 
GeneralRe: user data system for a web-based e-mail service Pin
Eddy Vluggen10-Feb-24 10:14
professionalEddy Vluggen10-Feb-24 10:14 
QuestionSilly Logging Question Pin
Kevin Marois27-Dec-23 17:05
professionalKevin Marois27-Dec-23 17:05 
I'm using Serilog. It seems way over-engineered to me, but I'm stuck with it. And, the docs arn't very helpful IMO.

My question is about log levels. For Serilog, there's documentation like this[^] and examples like this:
Log.Verbose("Here's a Verbose message.");
Log.Debug("Here's a Debug message. Only Public Properties (not fields) are shown on structured data. Structured data: {@sampleData}. Simple data: {simpleData}.", structuredData, simpleData);
Log.Information(new Exception("Exceptions can be put on all log levels"), "Here's an Info message.");
Log.Warning("Here's a Warning message.");
Log.Error(new Exception("This is an exception."), "Here's an Error message.");
Log.Fatal("Here's a Fatal message.");

Neither the docs nor the examples explain very well where/how you would actually use each of these levels.

For example, let's says I have this method:
private void DoSomeProcessing(string inputFile, bool someParam)
{
    Log.Information("Inside DoSomeProcessing");

    if (someParam)
    {
        Log.Warning("Just letting you know that 'someParam' = true");
    }

    if (string.IsNullOrEmpty(inputFile))
    {
        Log.Error("inputFile is null");
        throw new ArgumentNullException(nameof(inputFile));
    }

    try
    {
        Log.Information("Doing the processing");
        var a = 10 + 20;

        Log.Information("Doing some more");
        var b = 10 + a;

        Log.Information("And even more");
        var v = a + b;
    }
    catch (Exception e)
    {
        Log.Fatal("Something terrible happened here!");
        throw e;
    }
}
Exception logging I get, but is this how you would Info and Debug? Writing out lines all over the place?

Also, I have "MinimumLevel": "Debug" in my appsettings.json, yet all of these line get written out.

I'm guuessing I'm not understanding how to use it right. Can someone shed some light? Thanks
In theory, theory and practice are the same. But in practice, they never are.”
If it's not broken, fix it until it is.
Everything makes sense in someone's mind.

AnswerRe: Silly Logging Question Pin
Mircea Neacsu27-Dec-23 17:32
Mircea Neacsu27-Dec-23 17:32 
AnswerRe: Silly Logging Question Pin
jschell28-Dec-23 6:25
jschell28-Dec-23 6:25 
QuestionImplementing domain driven design Pin
Jan Hein de Jong23-Dec-23 10:41
Jan Hein de Jong23-Dec-23 10:41 
AnswerRe: Implementing domain driven design Pin
Gerry Schmitz24-Dec-23 6:34
mveGerry Schmitz24-Dec-23 6:34 
GeneralWhy I don't do MVVM. Pin
Gerry Schmitz22-Dec-23 9:46
mveGerry Schmitz22-Dec-23 9:46 
GeneralRe: Why I don't do MVVM. Pin
Greg Utas22-Dec-23 14:46
professionalGreg Utas22-Dec-23 14:46 
GeneralRe: Why I don't do MVVM. Pin
jschell25-Dec-23 7:53
jschell25-Dec-23 7:53 
GeneralRe: Why I don't do MVVM. Pin
Greg Utas25-Dec-23 8:28
professionalGreg Utas25-Dec-23 8:28 
GeneralRe: Why I don't do MVVM. Pin
Dave Kreskowiak22-Dec-23 15:24
mveDave Kreskowiak22-Dec-23 15:24 
GeneralRe: Why I don't do MVVM. Pin
Gerry Schmitz23-Dec-23 7:30
mveGerry Schmitz23-Dec-23 7:30 
GeneralRe: Why I don't do MVVM. Pin
jschell25-Dec-23 7:55
jschell25-Dec-23 7:55 
GeneralRe: Why I don't do MVVM. Pin
Gerry Schmitz25-Dec-23 11:35
mveGerry Schmitz25-Dec-23 11:35 
GeneralRe: Why I don't do MVVM. Pin
jschell26-Dec-23 4:37
jschell26-Dec-23 4:37 
GeneralRe: Why I don't do MVVM. Pin
Gerry Schmitz26-Dec-23 7:03
mveGerry Schmitz26-Dec-23 7:03 
GeneralRe: Why I don't do MVVM. Pin
jschell27-Dec-23 5:19
jschell27-Dec-23 5:19 
QuestionLiterature on designing and implementing an access control system Pin
D4rkTrick8-Dec-23 2:17
professionalD4rkTrick8-Dec-23 2:17 
AnswerRe: Literature on designing and implementing an access control system Pin
Richard MacCutchan8-Dec-23 2:52
mveRichard MacCutchan8-Dec-23 2:52 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.