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

Refactor logging configuration to stop outputting logs to console #324

Merged
merged 1 commit into from
Sep 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Please see [here](https://github.com/hrntsm/Tunny/releases) for the data release
### Changed

- Default log file is set to "Verbose" with a retention period of 1 day.
- Stop to output log to console.

### Deprecated

Expand Down
1 change: 0 additions & 1 deletion Tunny.Core/Tunny.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

<ItemGroup>
<PackageReference Include="Serilog" Version="3.1.1" />
<PackageReference Include="Serilog.Sinks.Console" Version="5.0.1" />
<PackageReference Include="Serilog.Sinks.File" Version="5.0.0" />
<PackageReference Include="pythonnet" Version="3.0.1" />
<ProjectReference Include="..\Optuna\Optuna.csproj" />
Expand Down
1 change: 0 additions & 1 deletion Tunny.Core/Util/TLog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ public static void InitializeLogger()
SetInitialLogLevels();
Log.Logger = new LoggerConfiguration()
.MinimumLevel.ControlledBy(LevelSwitch)
.WriteTo.Console(formatProvider: CultureInfo.InvariantCulture)
.WriteTo.File(path: TEnvVariables.LogPath + "/log_.txt", rollingInterval: RollingInterval.Day, formatProvider: CultureInfo.InvariantCulture)
.CreateLogger();
Log.Information("Tunny is loaded.");
Expand Down
Loading