Skip to content

Commit

Permalink
LoggerService
Browse files Browse the repository at this point in the history
优化LoggerService性能
  • Loading branch information
BME-DDB committed May 28, 2019
1 parent 432aa7a commit 6aa643e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions spark-server/server/Framework/Service/Logger/LoggerService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ private void Startup(string loggerPath)
var fileTarget = new FileTarget("target")
{
FileName = logRoot + "logs/${shortdate}/" + filePrefix + "${date:universalTime=false:format=yyyy_MM_dd_HH}.log",
Layout = "${longdate} ${message}"
Layout = "${longdate} ${message}",
KeepFileOpen = true,
AutoFlush = true,
};
config.AddTarget(fileTarget);

fileTarget.Layout = @"${longdate} ${message}";

config.AddRuleForAllLevels(fileTarget);

LogManager.Configuration = config;
Expand All @@ -55,7 +55,7 @@ private void OnLog(int source, int session, string method, byte[] param)
string outStr = string.Format("[{0:X8}] {1}", source, Encoding.ASCII.GetString(param));
m_logger.Info(outStr);

// Console.WriteLine("{0} source serviceId:{1} info:{2}", DateTime.Now, msg.Source, Encoding.ASCII.GetString(msg.Data));
// Console.WriteLine("{0}", outStr);
}
}
}

0 comments on commit 6aa643e

Please sign in to comment.