Skip to content

Feature Request: Support rotated filenames like app.1.log in MultiFile pattern #696

Closed

Description

@Pr0metheus2

Feature Request: Support mid-filename index tags ($J, $I) before file extensions

Problem

LogExpert currently only groups MultiFile chains if the index/sequence number is at the very end of the filename (e.g., app.log, app.log.1, app.log.2).

When rotated logs put the index before the extension (e.g., app.log, app.1.log, app.2.log), LogExpert fails to group them. Patterns like *$J(.).log or *$J(.) fail and only match app.log, app.log.1, app.log.2 etc.


Proposed Solution

Allow index tags ($J, $I) to appear before a fixed file extension suffix in the File name pattern mask.

Example Pattern: *$J(.).log

  • app.log ➔ Active log (Index 0, prefix + index hidden)
  • app.1.log ➔ Rotated log (Index 1)
  • app.2.log ➔ Rotated log (Index 2)

LogExpert should automatically combine them into a single MultiFile sequence.


Current Pattern Syntax Tested

Based on the application's supported syntax:

  • * = Any characters (wildcard)
  • $D(<date>) = Date pattern (DD, MM, YY[YY])
  • $I = File index number
  • $J = File index number, hidden when zero
  • $J(<prefix>) = Like $J, but adding <prefix> when non-zero

Why this is needed

Standard logging frameworks (such as log4net, NLog, log4j, and Linux logrotate) commonly output mid-filename index rotation (app.1.log). Users cannot always modify third-party log output formats.

Activity

  1. Hirogen commented on Aug 25, 2026

    @Hirogen
    Member

    Multifile Filenamepattern is a regex, so this should already work!
    https://github.com/LogExperts/LogExpert/wiki/Settings

  2. Hirogen commented on Aug 25, 2026

    @Hirogen
    Member
    Image
  3. Pr0metheus2 commented on Aug 25, 2026

    @Pr0metheus2
    ContributorAuthor

    But it's not working.

  4. Hirogen commented on Aug 25, 2026

    @Hirogen
    Member

    But it's not working.

    that would be a bug ;)

  5. Pr0metheus2 commented on Aug 26, 2026

    @Pr0metheus2
    ContributorAuthor

    Found solution: In src\LogExpert.Core\Classes\Log\RolloverFilenameBuilder.cs - the parser is dropping literal text after the final placeholder, including .log. New fix will accept these patterns:

    *$J(.)     → app.log, app.log.1, app.log.2
    *$J(.).log → app.log, app.1.log, app.2.log
    

    Also Legend needs to be updated to reflect these changes, as well as incorrectly displayed <date> and <prefix> placeholders in English and German resources.

  6. added a commit that references this issue on Sep 21, 2026
  7. linked a pull request that will close this issueFix/MultiFile pattern (Issue #696) #697on Sep 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions