LogHookContext class

Context on a log

Extends

Constructors

LogHookContext(LogHookContextInit)

For testing purposes only. This will always be constructed for you when run in the context of the Azure Functions runtime

Properties

category

'system' if the log is generated by Azure Functions, 'user' if the log is generated by your own app.

invocationContext

If the log occurs during a function execution, the context object passed to the function handler. Otherwise, undefined.

level

Changes to this value will affect the resulting log, but only for user-generated logs.

message

Changes to this value will affect the resulting log, but only for user-generated logs.

Inherited Properties

hookData

The recommended place to store and share data between hooks in the same scope (app-level vs invocation-level). You should use a unique property name so that it doesn't conflict with other hooks' data. This object is readonly. You may modify it, but attempting to overwrite it will throw an error

Constructor Details

LogHookContext(LogHookContextInit)

For testing purposes only. This will always be constructed for you when run in the context of the Azure Functions runtime

new LogHookContext(init?: LogHookContextInit)

Parameters

Property Details

category

'system' if the log is generated by Azure Functions, 'user' if the log is generated by your own app.

category: LogCategory

Property Value

invocationContext

If the log occurs during a function execution, the context object passed to the function handler. Otherwise, undefined.

invocationContext: InvocationContext | undefined

Property Value

InvocationContext | undefined

level

Changes to this value will affect the resulting log, but only for user-generated logs.

level: LogLevel

Property Value

message

Changes to this value will affect the resulting log, but only for user-generated logs.

message: string

Property Value

string

Inherited Property Details

hookData

The recommended place to store and share data between hooks in the same scope (app-level vs invocation-level). You should use a unique property name so that it doesn't conflict with other hooks' data. This object is readonly. You may modify it, but attempting to overwrite it will throw an error

hookData: Record<string, unknown>

Property Value

Record<string, unknown>

Inherited From HookContext.hookData