From 18 Jan, 2021 0:00 UTC: All services will be temporary unavailable for maintenance
  • R/O
  • SSH
  • HTTPS

ewatch: Commit


Commit MetaInfo

Revision114 (tree)
Zeit2020-08-07 09:53:10
Autorbananajinn

Log Message

* ログ転送された時にnameが含まれていなければconfigファイルにある General.name を使う

* 1.0.32

Ändern Zusammenfassung

Diff

--- trunk/EWatch/EWatch/Properties/AssemblyInfo.cs (revision 113)
+++ trunk/EWatch/EWatch/Properties/AssemblyInfo.cs (revision 114)
@@ -24,5 +24,5 @@
2424 //
2525 // You can specify all the values or you can use the default the Revision and
2626 // Build Numbers by using the '*' as shown below:
27-[assembly: AssemblyVersion ("1.0.31")]
27+[assembly: AssemblyVersion ("1.0.32")]
2828 //[assembly: log4net.Config.XmlConfigurator(ConfigFile=@"Log4net.Config.xml", Watch=true)]
--- trunk/EWatch/EWatch/Server/Commands/PutCommand.cs (revision 113)
+++ trunk/EWatch/EWatch/Server/Commands/PutCommand.cs (revision 114)
@@ -30,6 +30,7 @@
3030 {
3131 var actionTable = LogMatcher.Match(_config.ServerRules, LogData);
3232 if(!Util.IsNullOrEmpty(actionTable)) {
33+ LogData.Name = LogData.Name ?? _config.General.Name;
3334 ActionExecutor.ExecuteAction(actionTable.Actions, LogData);
3435 }
3536 }
--- trunk/EWatch/EWatch/etc/EWatch.config.json (revision 113)
+++ trunk/EWatch/EWatch/etc/EWatch.config.json (revision 114)
@@ -85,7 +85,7 @@
8585 * ======================
8686 * 現在は次のアクションが指定可能です。
8787 * ・nop ... 何もしません。
88- * ・exec ... CommandLine で指定したコマンドを実行します。$timestamp $hostname $source $level $code $message が指定可能です。
88+ * ・exec ... CommandLine で指定したコマンドを実行します。$name $timestamp $hostname $source $level $code $message が指定可能です。
8989 * ・smtp ... ServerHost で指定したSMTPサーバーを利用して通知メールを送信します。
9090 * ・syslog ... RemoteHost で指定したsyslogサーバーにログを転送します。
9191 * ・mantis ... MantisBT に通知します。
@@ -92,6 +92,9 @@
9292 * ・slack ... Slack に通知します。
9393 */
9494 {
95+ General: {
96+ name: 'テスト名称'
97+ },
9598 Actions: [
9699 {
97100 name: 'forwardTest',
@@ -101,7 +104,8 @@
101104 {
102105 name: 'executeTest',
103106 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'
105109 },
106110 {
107111 name: 'mantisTest',
--- trunk/EWatch/EWatchCLI/Properties/AssemblyInfo.cs (revision 113)
+++ trunk/EWatch/EWatchCLI/Properties/AssemblyInfo.cs (revision 114)
@@ -28,4 +28,4 @@
2828 //
2929 // You can specify all the values or you can use the default the Revision and
3030 // Build Numbers by using the '*' as shown below:
31-[assembly: AssemblyVersion("1.0.31")]
31+[assembly: AssemblyVersion("1.0.32")]
--- trunk/EWatch/EWatchUI/Properties/AssemblyInfo.cs (revision 113)
+++ trunk/EWatch/EWatchUI/Properties/AssemblyInfo.cs (revision 114)
@@ -28,4 +28,4 @@
2828 //
2929 // You can specify all the values or you can use the default the Revision and
3030 // Build Numbers by using the '*' as shown below:
31-[assembly: AssemblyVersion("1.0.31")]
31+[assembly: AssemblyVersion("1.0.32")]
--- trunk/EWatch/EWatchView/Properties/AssemblyInfo.cs (revision 113)
+++ trunk/EWatch/EWatchView/Properties/AssemblyInfo.cs (revision 114)
@@ -28,4 +28,4 @@
2828 //
2929 // You can specify all the values or you can use the default the Revision and
3030 // Build Numbers by using the '*' as shown below:
31-[assembly: AssemblyVersion("1.0.31")]
31+[assembly: AssemblyVersion("1.0.32")]
--- trunk/EWatch/misc/put-with-name.bat (nonexistent)
+++ trunk/EWatch/misc/put-with-name.bat (revision 114)
@@ -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%"
--- trunk/EWatch/misc/put.bat (nonexistent)
+++ trunk/EWatch/misc/put.bat (revision 114)
@@ -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%"
Show on old repository browser