File tree Expand file tree Collapse file tree 1 file changed +17
-27
lines changed
src/SampleWebAPI/Controllers Expand file tree Collapse file tree 1 file changed +17
-27
lines changed Original file line number Diff line number Diff line change 1
- using System . Collections . Generic ;
1
+ using System ;
2
+ using System . Collections . Generic ;
2
3
using Microsoft . AspNetCore . Mvc ;
3
-
4
+ using Microsoft . Extensions . Logging ;
5
+
4
6
namespace VTEX . SampleWebAPI . Controllers
5
7
{
6
8
[ Route ( "api/[controller]" ) ]
7
9
public class ValuesController : Controller
8
10
{
11
+ readonly ILogger logger ;
12
+
13
+ public ValuesController ( ILoggerFactory loggerFactory )
14
+ {
15
+ logger = loggerFactory . CreateLogger < ValuesController > ( ) ;
16
+ }
17
+
9
18
// GET api/values
10
19
[ HttpGet ]
11
20
public IEnumerable < string > Get ( )
12
21
{
22
+ logger . DefineVTEXLog ( LogLevel . Critical ,
23
+ "Values Controller" ,
24
+ "api/values" ,
25
+ string . Empty ,
26
+ new NotImplementedException ( ) ,
27
+ new Tuple < string , string > ( "method" , "GET" ) ) ;
13
28
return new string [ ] { "value1" , "value2" } ;
14
29
}
15
-
16
- // GET api/values/5
17
- [ HttpGet ( "{id}" ) ]
18
- public string Get ( int id )
19
- {
20
- return "value" ;
21
- }
22
-
23
- // POST api/values
24
- [ HttpPost ]
25
- public void Post ( [ FromBody ] string value )
26
- {
27
- }
28
-
29
- // PUT api/values/5
30
- [ HttpPut ( "{id}" ) ]
31
- public void Put ( int id , [ FromBody ] string value )
32
- {
33
- }
34
-
35
- // DELETE api/values/5
36
- [ HttpDelete ( "{id}" ) ]
37
- public void Delete ( int id )
38
- {
39
- }
40
30
}
41
31
}
You can’t perform that action at this time.
0 commit comments