Oleg Sh
Oleg Sh

Reputation: 9013

Azure WebJobs: difference between Console.WriteLine and logger.WriteLine

The method of webjob can have TextWriter logger as parameter. But if I call:

logger.WriteLine("Test");
Console.WriteLine("Test");

it does the same. Just write "INFO" record to console and logfile.

What is difference between them and what sense to have TextWriter logger as parameter?

Upvotes: 1

Views: 528

Answers (1)

Janley Zhang
Janley Zhang

Reputation: 1577

it does the same. Just write "INFO" record to console and logfile.

Yes, they all could achieve the above function in web job. You can use any of them in web job. Just the official definition has slightly different. And the TextWriter logger parameter is optional in method.

Upvotes: 2

Related Questions