customLogger
- Type: Logger
- Default:
undefined
Uses a custom logger instance for the current Rsbuild instance.
Example
Use createLogger to create a new logger instance.
rsbuild.config.ts
Global logger vs instance logger
Rsbuild provides two ways to access a logger:
- The global logger is the shared logger singleton exported from
@rsbuild/core. - The instance logger is the logger associated with the current Rsbuild instance, exposed as rsbuild.logger or api.logger in plugins.
When customLogger is not set, the instance logger falls back to the shared global logger. When customLogger is set, the instance logger references that custom logger instead.

