Azure / Azure/azure-functions-nodejs-library

Context Logging not in Sequential order

Open
#191 11 comments 11 reactions 0 assignees View on GitHub
area:nodejs-functions bug P2 upstream
Dominant language
TypeScript
Stars
70
Forks
35
Avg merge
4d 18h
Merged PRs (30d)
6

Description

Created the basic Http Trigger in Node Js 18 LTS Azure Functions using VS Code.

```
module.exports = async function (context) {
context.log('JavaScript HTTP trigger function processed a request.');

context.log.info({ a: 'first object', b: { q: 'test 1' } });
context.log.info({ a: 'second object', b: { q: 'test 2' } });
context.log.info({ a: 'third object', b: { q: 'test 3' } });

context.log.info(JSON.stringify({ a: 'first string', b: { q: 'test 1' } }));
context.log.info(JSON.stringify({ a: 'second string', b: { q: 'test 2' } }));
context.log.info(JSON.stringify({ a: 'third string', b: { q: 'test 3' } }));

context.log.info('first simple string');
context.log.info('second simple string');
context.log.info('third simple string');
const responseMessage = "Hello Krishna, This Http Triggered Function executed successfully."

context.res = {
// status: 200, /* Defaults to 200 */
body: responseMessage
};
}
```

The way I have written my log statements are not coming in the terminal with the same order when I run my function.

![image](https://user-images.githubusercontent.com/88704316/224697100-b4f194c5-6cce-4bb4-8dfe-669e3670df83.png)

Is it the behavior of `Context.Log()` or am I missing something?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.