Revision | 114 (tree) |
---|---|
Zeit | 2020-08-07 09:53:10 |
Autor | ![]() |
* ログ転送された時にnameが含まれていなければconfigファイルにある General.name を使う
* 1.0.32
@@ -24,5 +24,5 @@ | ||
24 | 24 | // |
25 | 25 | // You can specify all the values or you can use the default the Revision and |
26 | 26 | // Build Numbers by using the '*' as shown below: |
27 | -[assembly: AssemblyVersion ("1.0.31")] | |
27 | +[assembly: AssemblyVersion ("1.0.32")] | |
28 | 28 | //[assembly: log4net.Config.XmlConfigurator(ConfigFile=@"Log4net.Config.xml", Watch=true)] |
@@ -30,6 +30,7 @@ | ||
30 | 30 | { |
31 | 31 | var actionTable = LogMatcher.Match(_config.ServerRules, LogData); |
32 | 32 | if(!Util.IsNullOrEmpty(actionTable)) { |
33 | + LogData.Name = LogData.Name ?? _config.General.Name; | |
33 | 34 | ActionExecutor.ExecuteAction(actionTable.Actions, LogData); |
34 | 35 | } |
35 | 36 | } |
@@ -85,7 +85,7 @@ | ||
85 | 85 | * ====================== |
86 | 86 | * 現在は次のアクションが指定可能です。 |
87 | 87 | * ・nop ... 何もしません。 |
88 | - * ・exec ... CommandLine で指定したコマンドを実行します。$timestamp $hostname $source $level $code $message が指定可能です。 | |
88 | + * ・exec ... CommandLine で指定したコマンドを実行します。$name $timestamp $hostname $source $level $code $message が指定可能です。 | |
89 | 89 | * ・smtp ... ServerHost で指定したSMTPサーバーを利用して通知メールを送信します。 |
90 | 90 | * ・syslog ... RemoteHost で指定したsyslogサーバーにログを転送します。 |
91 | 91 | * ・mantis ... MantisBT に通知します。 |
@@ -92,6 +92,9 @@ | ||
92 | 92 | * ・slack ... Slack に通知します。 |
93 | 93 | */ |
94 | 94 | { |
95 | + General: { | |
96 | + name: 'テスト名称' | |
97 | + }, | |
95 | 98 | Actions: [ |
96 | 99 | { |
97 | 100 | name: 'forwardTest', |
@@ -101,7 +104,8 @@ | ||
101 | 104 | { |
102 | 105 | name: 'executeTest', |
103 | 106 | type: 'execute', |
104 | - CommandLine: '"C:\\Program Files (x86)\\Growl for Windows\\growlnotify.exe" /t:EWatch "$message"' | |
107 | + _CommandLine: '"C:\\Program Files (x86)\\Growl for Windows\\growlnotify.exe" /t:EWatch "$message"', | |
108 | + CommandLine: 'cmd /c echo $timestamp [$name] $message' | |
105 | 109 | }, |
106 | 110 | { |
107 | 111 | name: 'mantisTest', |
@@ -28,4 +28,4 @@ | ||
28 | 28 | // |
29 | 29 | // You can specify all the values or you can use the default the Revision and |
30 | 30 | // Build Numbers by using the '*' as shown below: |
31 | -[assembly: AssemblyVersion("1.0.31")] | |
31 | +[assembly: AssemblyVersion("1.0.32")] |
@@ -28,4 +28,4 @@ | ||
28 | 28 | // |
29 | 29 | // You can specify all the values or you can use the default the Revision and |
30 | 30 | // Build Numbers by using the '*' as shown below: |
31 | -[assembly: AssemblyVersion("1.0.31")] | |
31 | +[assembly: AssemblyVersion("1.0.32")] |
@@ -28,4 +28,4 @@ | ||
28 | 28 | // |
29 | 29 | // You can specify all the values or you can use the default the Revision and |
30 | 30 | // Build Numbers by using the '*' as shown below: |
31 | -[assembly: AssemblyVersion("1.0.31")] | |
31 | +[assembly: AssemblyVersion("1.0.32")] |
@@ -0,0 +1,17 @@ | ||
1 | +@echo off | |
2 | +set MESSAGE=%~1 | |
3 | +set LEVEL=%~2 | |
4 | +set SOURCE=%~3 | |
5 | +set CODE=%~4 | |
6 | +set NAME=%~5 | |
7 | + | |
8 | +if "%LEVEL%" == "" set LEVEL=E | |
9 | +if "%SOURCE%" == "" set SOURCE=test | |
10 | +if "%CODE%" == "" set CODE=9 | |
11 | +if "%MESSAGE%" == "" set MESSAGE=テストメッセージ | |
12 | +if "%NAME%" == "" set NAME=TEST NAME | |
13 | + | |
14 | +set CLI="..\EWatchCLI\bin\Debug\EWatchCLI.exe" | |
15 | +set NOW=%DATE:/=-% %TIME: =0% | |
16 | +set DATA={LogData:{Message:\"%MESSAGE%\",Level:\"%LEVEL%\",Code:\"%CODE%\",Source:\"%SOURCE%\",HostName:\"%COMPUTERNAME%\",TimeStamp:\"%NOW%\",Name:\"%NAME%\"}} | |
17 | +%CLI% put "%DATA%" |
@@ -0,0 +1,15 @@ | ||
1 | +@echo off | |
2 | +set MESSAGE=%~1 | |
3 | +set LEVEL=%~2 | |
4 | +set SOURCE=%~3 | |
5 | +set CODE=%~4 | |
6 | + | |
7 | +if "%LEVEL%" == "" set LEVEL=E | |
8 | +if "%SOURCE%" == "" set SOURCE=test | |
9 | +if "%CODE%" == "" set CODE=9 | |
10 | +if "%MESSAGE%" == "" set MESSAGE=テストメッセージ | |
11 | + | |
12 | +set CLI="..\EWatchCLI\bin\Debug\EWatchCLI.exe" | |
13 | +set NOW=%DATE:/=-% %TIME: =0% | |
14 | +set DATA={LogData:{Message:\"%MESSAGE%\",Level:\"%LEVEL%\",Code:\"%CODE%\",Source:\"%SOURCE%\",HostName:\"%COMPUTERNAME%\",TimeStamp:\"%NOW%\"}} | |
15 | +%CLI% put "%DATA%" |