sevdokimov / log-viewer

Web UI for viewing logs
Apache License 2.0
466 stars 106 forks source link

Log files cannot be opened #137

Closed Olivier6767 closed 1 year ago

Olivier6767 commented 2 years ago

I use LogRotate to manage the archival of logfiles. It is dobe by adding a .1, .2, .3 extension to the file name.

logfilesList

I added this entry in the config file so that the files are listed in log-viewer:

` { path: "/logs/*/*.log*" // Shows files like ".log.1" },

{ path: "/logs/*/*.txt\" // Shows files with ".txt.1" },`

The files appear in Log-Viewer but when I click on them nothing happens, they do not open, the content is not displayed.

LogViewver

The current logfile, (with extension .log or .txt) opens fine.

Am I missing something?

sevdokimov commented 2 years ago

The File browser doesn't use that configuration to detect the file type. It detects file type by the hardcoded pattern. "*.log.txt.3" doesn't match that pattern. There is no way to fix the file browser, but the files are available by the direct link: http://localhost:8333/log?path=/logs/node/webgrabplus/WebGrab++.log.txt.1

It's not convenient to copypaste the path to URL, you can create a shortcut to open all WebGrab++.log.txt* files on one page. Add the following configuration:

log-paths {
    WebGrab = {
        file = "/logs/node/webgrabplus/WebGrab++.log.txt*"
    }
}

And all WebGrab logs will be available on http://localhost:8333/log?path=WebGrab URL

Olivier6767 commented 1 year ago

Ok, thanks for the tip.