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

[Good First Issues]: Configuring Serilog through appsettings.json file #520

Open
deleteLater opened this issue Oct 20, 2023 · 2 comments
Open
Labels
asp.net core c# good first issue Good for newcomers help wanted Extra attention is needed points:8

Comments

@deleteLater
Copy link
Contributor

deleteLater commented Oct 20, 2023

Description

Currently, we configure the Serilog by code in Api and Evaluation Server projects, which is not convenient. We want to configure the Serilog through appsetting.json or appsettings.Development.json.

Log.Logger = new LoggerConfiguration()
.MinimumLevel.Override("Microsoft.AspNetCore", LogEventLevel.Warning)
.Enrich.FromLogContext()
.Enrich.WithClientIp("X-Forwarded-For")
.Enrich.WithRequestHeader("User-Agent")
.WriteTo.Console(new CompactJsonFormatter())
.CreateLogger();

Log.Logger = new LoggerConfiguration()
.MinimumLevel.Override("Microsoft.AspNetCore", LogEventLevel.Warning)
.Enrich.FromLogContext()
.WriteTo.Console(new CompactJsonFormatter())
.CreateLogger();

Reference

Scope

  • Api
  • Evaluation Server

Setup dev environment

Please read the doc to set up your development environment.

Deadline

If you have any difficulties, please contact us in Slack.

How to implement

  1. Fork the FeatBit repository.
  2. Create a branch issues-{issues number}
  3. Implement the task based on Description and Scope mentioned above.
  4. Submit your PR

Contribution points

Each contribution counts a certain number of points, depending on its difficulty. Contributors earn the appropriate
points when the work is merged. Contribution points are used to describe the contributions that contributors have made.
They can also be used to receive rewards for community events. You can view the current community submissions on a
public google sheet.

Points: 8

How to claim to solve the issue

If you want to implement this function, please leave a comment in this issue like:

I'd like to implement this function, please assign this issue to me.

@deleteLater deleteLater added good first issue Good for newcomers help wanted Extra attention is needed points:4 points:8 and removed points:4 labels Oct 20, 2023
@deleteLater deleteLater changed the title [Good First Issues]: XXX [Good First Issues]: Configuring Serilog through appsettings.json file Oct 20, 2023
@nrubiano
Copy link

I'd like to implement this function, please assign this issue to me.

@deleteLater
Copy link
Contributor Author

Thanks @nrubiano, I've assigned this issue to you 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
asp.net core c# good first issue Good for newcomers help wanted Extra attention is needed points:8
Projects
Status: Todo
Development

No branches or pull requests

3 participants