Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: extra separator #75

Merged
merged 1 commit into from
Jan 12, 2022
Merged

fix: extra separator #75

merged 1 commit into from
Jan 12, 2022

Conversation

lamweili
Copy link
Contributor

@lamweili lamweili commented Jan 12, 2022

Fixes #64

Related to log4js-node/log4js-node#1039

const log4js = require('log4js');
log4js.configure({
  appenders: {
    test1: { 
      type: 'dateFile', 
      filename: 'test1.log', 
      pattern: 'yyyy-MM-dd', 
      alwaysIncludePattern: true, 
      keepFileExt: true
    },
    test2: { 
      type: 'dateFile', 
      filename: 'test2.log', 
      pattern: 'yyyy-MM-dd',
      fileNameSep: '_',
      alwaysIncludePattern: true, 
      keepFileExt: true
    },
    test3: { 
      type: 'dateFile', 
      filename: 'test3.log', 
      pattern: '.yyyy-MM-dd', 
      alwaysIncludePattern: true, 
      keepFileExt: true
    },
    test4: { 
      type: 'dateFile', 
      filename: 'test4.log', 
      pattern: '-yyyy-MM-dd', 
      alwaysIncludePattern: true, 
      keepFileExt: true
    },
    test5: { 
      type: 'dateFile', 
      filename: 'test5.log', 
      pattern: '.-yyyy-MM-dd', 
      alwaysIncludePattern: true, 
      keepFileExt: true
    },
  },
  categories: {
    default: { appenders: [ 'test1', 'test2', 'test3', 'test4', 'test5' ], level: 'debug' }
  }
});
Pattern Separator Expected Actual Test
yyyy-MM-dd . (default) test1.2022-01-07.log test1.2022-01-07.log ✔️
yyyy-MM-dd _ test2_2022-01-07.log test2_2022-01-07.log ✔️
.yyyy-MM-dd . (default) test3..2022-01-07.log test3..2022-01-07.log ✔️
-yyyy-MM-dd . (default) test4.-2022-01-07.log test4.-2022-01-07.log ✔️
.-yyyy-MM-dd . (default) test5..-2022-01-07.log test5..-2022-01-07.log ✔️

@lamweili lamweili added this to the 3.0.0 milestone Jan 12, 2022
@lamweili lamweili removed this from the 3.0.0 milestone Jan 12, 2022
@lamweili lamweili closed this Jan 12, 2022
@lamweili lamweili reopened this Jan 12, 2022
@lamweili lamweili changed the title fix: parsing errors when FILENAME_SEP is used in pattern fix: extra separator Jan 12, 2022
@lamweili lamweili added this to the 3.0.0 milestone Jan 12, 2022
@lamweili lamweili merged commit 94279ca into master Jan 12, 2022
@lamweili lamweili deleted the fix-FILENAME_SEP-in-pattern branch January 12, 2022 18:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

There is an extra separator.
1 participant