# Logger class · @imqueue/async-logger

Source: https://imqueue.org/api/async-logger/latest/async-logger.logger/
Published: 2026-07-31
Author: @imqueue maintainers (https://github.com/imqueue)
Package: @imqueue/async-logger 3.2.0 — generated reference, not hand-written

Logger that writes to the console without blocking the caller and forwards the same records to any configured winston transports.

**Signature:**

```typescript
export declare class Logger implements ILogger 
```
**Implements:** [ILogger](https://imqueue.org/api/async-logger/latest/async-logger.ilogger/)

## Remarks

Implements [ILogger](https://imqueue.org/api/async-logger/latest/async-logger.ilogger/), so it drops into anything in `@imqueue` that accepts a logger — `IMQClient`, `IMQService`, `RedisCache` — replacing the default synchronous console.

Console output is scheduled with `setTimeout` rather than written inline. That is the point of the package: a service logging heavily does not pay for it on the request path. It also means ordering against synchronous code is not guaranteed, and output queued at the moment of `process.exit()` is lost.

Transports are optional. Constructed with none — the default when `LOGGER_TRANSPORTS` is unset — this behaves as an async console logger and never touches winston.

## Example


```typescript
import { Logger } from '@imqueue/async-logger';

// configured from LOGGER_TRANSPORTS / LOGGER_METADATA
const logger = new Logger();

// or explicitly, e.g. to tag one subsystem differently
const audit = new Logger({
    transports: [{ type: 'file', options: { filename: 'audit.log' }, enabled: true }],
    metadata: { subsystem: 'audit' },
});

audit.info('user %s signed in', userId);
```

## Constructors


| Constructor | Modifiers | Description |
| --- | --- | --- |
| [(constructor)(options)](https://imqueue.org/api/async-logger/latest/async-logger.logger._constructor_/) |  | Constructs a new instance of the `Logger` class |


## Methods


| Method | Modifiers | Description |
| --- | --- | --- |
| [error(args)](https://imqueue.org/api/async-logger/latest/async-logger.logger.error/) |  | Logs at ERROR level. |
| [info(args)](https://imqueue.org/api/async-logger/latest/async-logger.logger.info/) |  | Logs at INFO level — routine progress worth keeping. |
| [log(args)](https://imqueue.org/api/async-logger/latest/async-logger.logger.log/) |  | Logs to the console and to every configured transport. |
| [warn(args)](https://imqueue.org/api/async-logger/latest/async-logger.logger.warn/) |  | Logs at WARN level — something recovered from, but worth seeing. |

