Skip to content

How to customise log file name #1039

@aadgithub

Description

@aadgithub

Hi
I am using log4js version 6.2.1

I have configure logs level with following way in json file.
{ "appenders": { "Application": { "type": "dateFile", "filename": "logs/Application", "alwaysIncludePattern": true, "category": "Application", "layout": { "type": "pattern", "pattern": "<log timestamp=\"%d{yyyy-MM-dd hh:mm:ss.SSS}\" level=\"%5.5p\"><message>%m</message></log>" } }, "Database": { "type": "dateFile", "filename": "logs/Database", "alwaysIncludePattern": true, "category": "Database", "layout": { "type": "pattern", "pattern": "<log timestamp=\"%d{yyyy-MM-dd hh:mm:ss.SSS}\" level=\"%5.5p\"><message>%m</message></log>" } } } }

it is creating logs files daily with default name pattern like
Application.2020-08-07
Database.2020-08-07

I want to create file name with hyphen, like
Application-2020-08-07
Database-2020-08-07

is there any configuration to use custom file name?

Metadata

Metadata

Assignees

No one assigned

    Labels

    dependenciesPull requests that update a dependency file

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions