Skip to content

Commit

Permalink
add logging to std out in service mode (#15277)
Browse files Browse the repository at this point in the history
  • Loading branch information
pinzart90 authored Jun 5, 2024
1 parent 2bec009 commit a707f7f
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions src/DynamoCore/Logging/DynamoLogger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -209,19 +209,13 @@ private void Log(string message, LogLevel level, bool reportModification)
{
lock (this.guardMutex)
{
// In test mode, write the logs only to std out.
if (testMode && !cliMode)
// In test mode or service mode, write the logs only to std out.
if ((testMode && !cliMode) || serviceMode)
{
Console.WriteLine(string.Format("{0} : {1}", DateTime.UtcNow.ToString("u"), message));
return;
}

if (serviceMode && (level == LogLevel.Console || level == LogLevel.File))
{
Console.WriteLine("LogLevel switched to ConsoleOnly in service mode");
level = LogLevel.ConsoleOnly;
}

switch (level)
{
//write to the console only
Expand Down

0 comments on commit a707f7f

Please sign in to comment.