Skip to main content

initializeLogger

chainalign-backend


chainalign-backend / services/appLogger / initializeLogger

Function: initializeLogger()

initializeLogger(): Promise<void>

Defined in: services/appLogger.js:32

Initializes the application logger. This function should be called once at application startup. It attempts to configure a connection to Google Cloud Logging using the credentials specified in the GOOGLE_APPLICATION_CREDENTIALS environment variable.

If the environment variable is not set, or if the client fails to initialize for any reason, it gracefully falls back to using the standard console for all log outputs. This ensures that logging is always available, even in a local development environment.

Note: This function uses console for its own logs during the initialization process, as the main logger is not yet available.

Returns

Promise<void>

A promise that resolves when the logger is initialized.