개정판 1223cf64
DownloadManager 로그 출력 수정
Change-Id: Ifc79b236fd2dc598c83becc18b4ced6dffdf26ae
DownloadManager/Program.cs | ||
---|---|---|
1 | 1 |
|
2 | 2 |
using log4net; |
3 | 3 |
using System; |
4 |
using System.Collections.Generic; |
|
5 | 4 |
using System.Diagnostics; |
6 |
using System.Globalization; |
|
7 | 5 |
using System.Linq; |
8 |
using System.Text; |
|
9 |
using System.Threading.Tasks; |
|
10 | 6 |
|
11 | 7 |
namespace DownloadManager |
12 | 8 |
{ |
... | ... | |
37 | 33 |
// Culture = new CultureInfo("en-US") |
38 | 34 |
// }); |
39 | 35 |
|
40 |
|
|
36 |
private static void ChangeLogFileName(string name) |
|
37 |
{ |
|
38 |
log4net.Repository.ILoggerRepository RootRep; |
|
39 |
RootRep = logger.Logger.Repository;// LogManager.GetRepository(Assembly.GetCallingAssembly()); |
|
40 |
|
|
41 |
if (RootRep?.GetAppenders().Count() > 0) |
|
42 |
{ |
|
43 |
(RootRep.GetAppenders().First() as log4net.Appender.RollingFileAppender).File = string.Format((RootRep.GetAppenders().First() as log4net.Appender.RollingFileAppender).File, name); |
|
44 |
(RootRep.GetAppenders().First() as log4net.Appender.RollingFileAppender).ActivateOptions(); |
|
45 |
} |
|
46 |
} |
|
47 |
|
|
41 | 48 |
static void Main(string[] args) |
42 | 49 |
{ |
43 | 50 |
try |
44 | 51 |
{ |
52 |
ChangeLogFileName($"{DateTime.Now.ToString("yyMMddssmm")}_{args[0]}"); |
|
53 |
|
|
45 | 54 |
logger.Info($"param : {string.Join(",", args)}"); |
46 | 55 |
|
47 | 56 |
if (args.Length > 0) |
내보내기 Unified diff