-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFunction1.cs
More file actions
27 lines (26 loc) · 801 Bytes
/
Function1.cs
File metadata and controls
27 lines (26 loc) · 801 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
using System;
using Microsoft.Azure.WebJobs;
using Microsoft.Azure.WebJobs.Host;
using Microsoft.Extensions.Logging;
//using NLog;
//using Microsoft.Extensions.Logging;
namespace NLogSample
{
public class Function1
{
//private readonly NLog.ILogger _logger;
private readonly ILogger<Function1> log;
public Function1(ILogger<Function1> logger1)
{
// _logger = logger;
log = logger1;
}
[FunctionName("Function1")]
public void Run([TimerTrigger("* * * * * *")]TimerInfo myTimer)
{
//_logger.Info("Hello sir");
log.LogInformation($"C# Timer trigger function executed at: {DateTime.Now}");
log.LogError("This is example of error log printing");
}
}
}