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

HTTP Logging - Don't log everything! #150

Open
ilhesam opened this issue Aug 30, 2022 · 1 comment
Open

HTTP Logging - Don't log everything! #150

ilhesam opened this issue Aug 30, 2022 · 1 comment
Assignees

Comments

@ilhesam
Copy link
Collaborator

ilhesam commented Aug 30, 2022

As a developer, I don't want log everything in my project.
Ok, Why?

  1. The request and response of some endpoints/actions have critical data (username, password, access token, etc.).
  2. I don't need to logging some data.

I will write the available solutions below.

@ilhesam ilhesam self-assigned this Aug 30, 2022
@ilhesam
Copy link
Collaborator Author

ilhesam commented Aug 30, 2022

The first solution is using attribute to avoid to log critical data/properties, Like this:

public class LoginRequest
{
    [LogIgnore]
    public string UserName { get; set; }

    [LogIgnore]
    public string Password { get; set; }
}

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

When branches are created from issues, their pull requests are automatically linked.

1 participant