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 ;
23using Microsoft . AspNetCore . Mvc ;
3-
4+ using Microsoft . Extensions . Logging ;
5+
46namespace VTEX . SampleWebAPI . Controllers
57{
68 [ Route ( "api/[controller]" ) ]
79 public class ValuesController : Controller
810 {
11+ readonly ILogger logger ;
12+
13+ public ValuesController ( ILoggerFactory loggerFactory )
14+ {
15+ logger = loggerFactory . CreateLogger < ValuesController > ( ) ;
16+ }
17+
918 // GET api/values
1019 [ HttpGet ]
1120 public IEnumerable < string > Get ( )
1221 {
22+ logger . DefineVTEXLog ( LogLevel . Critical ,
23+ "Values Controller" ,
24+ "api/values" ,
25+ string . Empty ,
26+ new NotImplementedException ( ) ,
27+ new Tuple < string , string > ( "method" , "GET" ) ) ;
1328 return new string [ ] { "value1" , "value2" } ;
1429 }
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- }
4030 }
4131}
You can’t perform that action at this time.
0 commit comments