ttu / dotnet-fake-json-server

Fake JSON Server is a Fake REST API that can be used as a Back End for prototyping or as a template for a CRUD Back End.
https://ttu.github.io/dotnet-fake-json-server/
MIT License
388 stars 84 forks source link

Reqeust to console and/or file? #31

Closed alexdresko closed 6 years ago

alexdresko commented 6 years ago

Great job on the .NET global tool! Works great!

Is there an option to tell fake server to simply output the request to the console or file?

If not, I'll be happy to try and help. Just point a finger in the best spot to implement the code and I'll make it happen.

ttu commented 6 years ago

Good that this works as a global tool 👍

I was just checking the logging that was used and this uses Serilog for logging.

I added Serilog Console Sink to master branch, so if you want to use Console logging just change Serilog configuration https://github.com/ttu/dotnet-fake-json-server/blob/master/FakeServer/appsettings.json#L9

How logging should be configured has changed few times with .NET Core versions so logging configuration seems to be pretty messy in this project. (Loggin configuration is in 2 properties in appsettings.json and configuration in Programs.cs and Startup.cs)

Do you want to fix logging configuration so it is done as it should be with .NET Core 2.1?

ttu commented 6 years ago

Did some cleanup and added logging section to README

Commits: https://github.com/ttu/dotnet-fake-json-server/commit/6120c0b082de21b1cdd9a0411ba2d4b92829d979 https://github.com/ttu/dotnet-fake-json-server/commit/aa101b17f73ba3d7919e00db8f24600f2b213772