@@ -13,7 +13,7 @@ namespace SampleWeb.Controllers
13
13
public class ValuesController : ControllerBase
14
14
{
15
15
private readonly ILogger < ValuesController > _logger ;
16
-
16
+
17
17
public ValuesController ( ILogger < ValuesController > logger )
18
18
{
19
19
_logger = logger ;
@@ -25,7 +25,7 @@ public string Get()
25
25
_logger . LogInformation ( "Get was called" ) ;
26
26
return $ "[{ Activity . Current ? . Id } ] { User . Identity ? . Name } ";
27
27
}
28
-
28
+
29
29
[ HttpGet ( "advanced-topic-user" ) ]
30
30
public string AdvancedTopicUser ( )
31
31
{
@@ -35,18 +35,18 @@ public string AdvancedTopicUser()
35
35
using ( LogContext . PushProperty ( Event . KnownDataKeys . UserInfo , new UserInfo ( User . Identity ? . Name + " Custom" , "Test User Full Name" ) , true ) ) {
36
36
_logger . LogInformation ( "This log event will have a custom user set." ) ;
37
37
}
38
-
38
+
39
39
return $ "[{ Activity . Current ? . Id } ] { User . Identity ? . Name } ";
40
40
}
41
-
41
+
42
42
[ HttpGet ( "advanced-topic-user-description" ) ]
43
43
public string AdvancedTopicUserDescription ( string description )
44
44
{
45
45
// User descriptions was intended to provide a description from an end user why an error happened.
46
46
using ( LogContext . PushProperty ( Event . KnownDataKeys . UserDescription , new UserDescription ( User . Identity ? . Name , description ) , true ) ) {
47
47
_logger . LogError ( new Exception ( "Test" ) , "This error event will have a user description set on it." ) ;
48
48
}
49
-
49
+
50
50
return $ "[{ Activity . Current ? . Id } ] { User . Identity ? . Name } ";
51
51
}
52
52
}
0 commit comments