microsoft/windows-container-tools

Filter file logs

david-garcia-garcia opened this issue · 1 comments

Currently there is no way to filter File logs. This is possible when using EventLog where you can choose minimum severity for logs that will be processed by LogMonitor. This can easily lead to flooding of non relevant container output when log files are monitored (i.e. IIS logs for requests).

Also, there is no way to distinguish in File based logs wether to write to standard output or standard error, making it difficult to reallly pinpoint when a problem is happening.

Describe the solution you'd like
I believe a regex based approach would be the most flexible.

     {
        "type": "File",
        "directory": "c:\\inetpub\\logs",
        "filter": "*.log",
        "includeSubdirectories": true,
        "includeFileNames": false,
        "stdOutMatch": "REGULAR EXPRESSION THAT LOG ENTRIES MUST MATCH TO BE REDIRECTED TO STANDARD OUTPUT",
        "stdErrorMatch": "REGULAR EXPRESSION THAT LOG ENTRIES MUST MATCH TO BE REDIRECTED TO STANDARD ERROR"
      }

Describe alternatives you've considered
None.

Unfortunately I haven't touched C/C++ for more than two decades now which makes it difficult to contribute a PR :(