Logging in a readable format

The logs should be readable, preferably, by both humans and machines.

To make the logs human readable, avoid complex encoding of events or errors (for higher programming languages, there is really no reason for numeric encoding of errors).

To make the logs machine readable, consider logging the events in the JSON format rather than clear text. For instance, instead of logging:

    Scored tweet: Loving the serverless compute :-), user: DivineOps,       sentiment score: 0.8760291

As we did in Chapter 6, Integrating Azure Functions with Cognitive Services API consider logging like this:

    Scored tweet: {'username':'DivineOps', 'tweetText':'Loving the       serverless compute :-)', 'sentimentScore': '0.8760291'}

Get Serverless computing in Azure with .NET now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.