3
3
4
4
using System ;
5
5
using System . Diagnostics ;
6
+ using System . Diagnostics . CodeAnalysis ;
6
7
using System . Diagnostics . Tracing ;
7
8
8
9
namespace Microsoft . Azure . WebJobs . Script . WebHost . Diagnostics
@@ -17,27 +18,27 @@ public void LogFunctionTraceEvent(TraceLevel level, string subscriptionId, strin
17
18
switch ( level )
18
19
{
19
20
case TraceLevel . Verbose :
20
- FunctionsEventSource . Instance . RaiseFunctionsEventVerbose ( subscriptionId , appName , functionName , eventName , source , details , summary , ScriptHost . Version , eventTimestamp ) ;
21
+ FunctionsSystemLogsEventSource . Instance . RaiseFunctionsEventVerbose ( subscriptionId , appName , functionName , eventName , source , details , summary , ScriptHost . Version , eventTimestamp ) ;
21
22
break ;
22
23
case TraceLevel . Info :
23
- FunctionsEventSource . Instance . RaiseFunctionsEventInfo ( subscriptionId , appName , functionName , eventName , source , details , summary , ScriptHost . Version , eventTimestamp ) ;
24
+ FunctionsSystemLogsEventSource . Instance . RaiseFunctionsEventInfo ( subscriptionId , appName , functionName , eventName , source , details , summary , ScriptHost . Version , eventTimestamp ) ;
24
25
break ;
25
26
case TraceLevel . Warning :
26
- FunctionsEventSource . Instance . RaiseFunctionsEventWarning ( subscriptionId , appName , functionName , eventName , source , details , summary , ScriptHost . Version , eventTimestamp ) ;
27
+ FunctionsSystemLogsEventSource . Instance . RaiseFunctionsEventWarning ( subscriptionId , appName , functionName , eventName , source , details , summary , ScriptHost . Version , eventTimestamp ) ;
27
28
break ;
28
29
case TraceLevel . Error :
29
30
if ( string . IsNullOrEmpty ( details ) && exception != null )
30
31
{
31
32
details = exception . ToString ( ) ;
32
33
}
33
- FunctionsEventSource . Instance . RaiseFunctionsEventError ( subscriptionId , appName , functionName , eventName , source , details , summary , ScriptHost . Version , eventTimestamp ) ;
34
+ FunctionsSystemLogsEventSource . Instance . RaiseFunctionsEventError ( subscriptionId , appName , functionName , eventName , source , details , summary , ScriptHost . Version , eventTimestamp ) ;
34
35
break ;
35
36
}
36
37
}
37
38
38
39
public void LogFunctionMetricEvent ( string subscriptionId , string appName , string eventName , long average , long minimum , long maximum , long count , DateTime eventTimestamp )
39
40
{
40
- FunctionsEventSource . Instance . LogFunctionMetricEvent ( subscriptionId , appName , eventName , average , minimum , maximum , count , ScriptHost . Version , eventTimestamp . ToString ( EventTimestamp ) ) ;
41
+ FunctionsSystemLogsEventSource . Instance . LogFunctionMetricEvent ( subscriptionId , appName , eventName , average , minimum , maximum , count , ScriptHost . Version , eventTimestamp . ToString ( EventTimestamp ) ) ;
41
42
}
42
43
43
44
public void LogFunctionExecutionAggregateEvent ( string siteName , string functionName , long executionTimeInMs , long functionStartedCount , long functionCompletedCount , long functionFailedCount )
@@ -86,49 +87,56 @@ public void LogFunctionExecutionEvent(string executionId, string siteName, int c
86
87
WriteEvent ( 57909 , executionId , siteName , concurrency , functionName , invocationId , executionStage , executionTimeSpan , success ) ;
87
88
}
88
89
}
90
+ }
91
+
92
+ [ EventSource ( Guid = "a7044dd6-c8ef-4980-858c-942d972b6250" ) ]
93
+ [ SuppressMessage ( "Microsoft.StyleCop.CSharp.NamingRules" , "SA1306:FieldNamesMustBeginWithLowerCaseLetter" , Justification = "Need to use Pascal Case for MDS column names" ) ]
94
+ public class FunctionsSystemLogsEventSource : EventSource
95
+ {
96
+ internal static readonly FunctionsSystemLogsEventSource Instance = new FunctionsSystemLogsEventSource ( ) ;
89
97
90
- [ Event ( 65520 , Level = EventLevel . Verbose , Channel = EventChannel . Operational ) ]
91
- public void RaiseFunctionsEventVerbose ( string subscriptionId , string appName , string functionName , string eventName , string source , string details , string summary , string hostVersion , string eventTimestamp )
98
+ [ Event ( 65520 , Level = EventLevel . Verbose , Channel = EventChannel . Operational , Version = 1 ) ]
99
+ public void RaiseFunctionsEventVerbose ( string SubscriptionId , string AppName , string FunctionName , string EventName , string Source , string Details , string Summary , string HostVersion , string EventTimestamp )
92
100
{
93
101
if ( IsEnabled ( ) )
94
102
{
95
- WriteEvent ( 65520 , subscriptionId , appName , functionName , eventName , source , details , summary , hostVersion , eventTimestamp ) ;
103
+ WriteEvent ( 65520 , SubscriptionId , AppName , FunctionName , EventName , Source , Details , Summary , HostVersion , EventTimestamp ) ;
96
104
}
97
105
}
98
106
99
- [ Event ( 65521 , Level = EventLevel . Informational , Channel = EventChannel . Operational ) ]
100
- public void RaiseFunctionsEventInfo ( string subscriptionId , string appName , string functionName , string eventName , string source , string details , string summary , string hostVersion , string eventTimestamp )
107
+ [ Event ( 65521 , Level = EventLevel . Informational , Channel = EventChannel . Operational , Version = 1 ) ]
108
+ public void RaiseFunctionsEventInfo ( string SubscriptionId , string AppName , string FunctionName , string EventName , string Source , string Details , string Summary , string HostVersion , string EventTimestamp )
101
109
{
102
110
if ( IsEnabled ( ) )
103
111
{
104
- WriteEvent ( 65521 , subscriptionId , appName , functionName , eventName , source , details , summary , hostVersion , eventTimestamp ) ;
112
+ WriteEvent ( 65521 , SubscriptionId , AppName , FunctionName , EventName , Source , Details , Summary , HostVersion , EventTimestamp ) ;
105
113
}
106
114
}
107
115
108
- [ Event ( 65522 , Level = EventLevel . Warning , Channel = EventChannel . Operational ) ]
109
- public void RaiseFunctionsEventWarning ( string subscriptionId , string appName , string functionName , string eventName , string source , string details , string summary , string hostVersion , string eventTimestamp )
116
+ [ Event ( 65522 , Level = EventLevel . Warning , Channel = EventChannel . Operational , Version = 1 ) ]
117
+ public void RaiseFunctionsEventWarning ( string SubscriptionId , string AppName , string FunctionName , string EventName , string Source , string Details , string Summary , string HostVersion , string EventTimestamp )
110
118
{
111
119
if ( IsEnabled ( ) )
112
120
{
113
- WriteEvent ( 65522 , subscriptionId , appName , functionName , eventName , source , details , summary , hostVersion , eventTimestamp ) ;
121
+ WriteEvent ( 65522 , SubscriptionId , AppName , FunctionName , EventName , Source , Details , Summary , HostVersion , EventTimestamp ) ;
114
122
}
115
123
}
116
124
117
- [ Event ( 65523 , Level = EventLevel . Error , Channel = EventChannel . Operational ) ]
118
- public void RaiseFunctionsEventError ( string subscriptionId , string appName , string functionName , string eventName , string source , string details , string summary , string hostVersion , string eventTimestamp )
125
+ [ Event ( 65523 , Level = EventLevel . Error , Channel = EventChannel . Operational , Version = 1 ) ]
126
+ public void RaiseFunctionsEventError ( string SubscriptionId , string AppName , string FunctionName , string EventName , string Source , string Details , string Summary , string HostVersion , string EventTimestamp )
119
127
{
120
128
if ( IsEnabled ( ) )
121
129
{
122
- WriteEvent ( 65523 , subscriptionId , appName , functionName , eventName , source , details , summary , hostVersion , eventTimestamp ) ;
130
+ WriteEvent ( 65523 , SubscriptionId , AppName , FunctionName , EventName , Source , Details , Summary , HostVersion , EventTimestamp ) ;
123
131
}
124
132
}
125
133
126
- [ Event ( 65524 , Level = EventLevel . Informational , Channel = EventChannel . Operational ) ]
127
- public void LogFunctionMetricEvent ( string subscriptionId , string appName , string eventName , long average , long minimum , long maximum , long count , string hostVersion , string eventTimestamp )
134
+ [ Event ( 65524 , Level = EventLevel . Informational , Channel = EventChannel . Operational , Version = 1 ) ]
135
+ public void LogFunctionMetricEvent ( string SubscriptionId , string AppName , string EventName , long Average , long Minimum , long Maximum , long Count , string HostVersion , string EventTimestamp )
128
136
{
129
137
if ( IsEnabled ( ) )
130
138
{
131
- WriteEvent ( 65524 , subscriptionId , appName , eventName , average , minimum , maximum , count , hostVersion , eventTimestamp ) ;
139
+ WriteEvent ( 65524 , SubscriptionId , AppName , EventName , Average , Minimum , Maximum , Count , HostVersion , EventTimestamp ) ;
132
140
}
133
141
}
134
142
}
0 commit comments