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

Update logging mechanism to make use of Serilog #179

Closed
AdmiringWorm opened this issue Dec 20, 2019 · 6 comments · Fixed by #180
Closed

Update logging mechanism to make use of Serilog #179

AdmiringWorm opened this issue Dec 20, 2019 · 6 comments · Fixed by #180
Assignees
Milestone

Comments

@AdmiringWorm
Copy link
Member

Detailed Description

Update GRM to make use of Serilog for logging purposes (both to file and to console).

Currently the logging mechanism uses custom logic to log text to a file, and normal Console calls to output to the console. However this should be changed to use Serilog instead.

Context

Quoting Gary:

add a proper logger into GRM, so we get a bit more control over the text that is written to the output

Possible Implementation

Already mentioned.

Your Environment

Not Important

@AdmiringWorm AdmiringWorm added this to the 0.10.0 milestone Dec 20, 2019
@AdmiringWorm AdmiringWorm self-assigned this Dec 20, 2019
@Cheesebaron
Copy link
Collaborator

I think we should consider using Microsoft.Extensions.Logging and then hook that up with Serilog in the "client", rather than taking a hard dependency on Serilog.

This will make it easy to switch to another Logging framework in the future if needed.

@AdmiringWorm
Copy link
Member Author

AdmiringWorm commented Dec 20, 2019

That could certainly be done as well.

@gep13 thoughts?

EDIT: This would require us to implement some kind of DI though.

@gep13
Copy link
Member

gep13 commented Dec 20, 2019

I have no objections to bringing that in.

I had thought about bringing in DI as well, since it would make the different providers easier to use.

@AdmiringWorm
Copy link
Member Author

@gep13 Sounds like more refactoring need to be done then.

Most likely we'll need to refactor the code base to have a single class we call for each command (which then again calls out to the correct provider).

I opened a draft with the implementation of Serilog, but without DI for now.
Not completely done yet, but getting there.

@arturcic
Copy link
Member

for the DI I would suggest Microsoft.Extensions.DependencyInjection, we used it for GitVersion

@AdmiringWorm
Copy link
Member Author

Created #181 for discussing and tracking implementation of a DI framework

gep13 added a commit that referenced this issue Jan 11, 2020
(GH-179) Replace custom logging with serilog implementation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants