sevdokimov / log-viewer

Web UI for viewing logs
Apache License 2.0
434 stars 103 forks source link

feat: add autostart service #183

Closed dima-bzz closed 1 year ago

dima-bzz commented 1 year ago

@sevdokimov I think that saving the log to a file should be done inside the application.

dima-bzz commented 1 year ago

@sevdokimov Why are 2 loggers used?

sevdokimov commented 1 year ago

@sevdokimov I think that saving the log to a file should be done inside the application.

Could you clarify what do you mean?

sevdokimov commented 1 year ago

@sevdokimov Why are 2 loggers used?

What loggers do you mean?

dima-bzz commented 1 year ago

@sevdokimov Why are 2 loggers used?

What loggers do you mean?

@sevdokimov logback and log4j inside log-viewer-cli.

dima-bzz commented 1 year ago

Could you clarify what do you mean?

@sevdokimov I mean that you need to configure saving the log to a file inside the application. For example, via logback. Because if you use the system saving of the log to a file, then users will still have to take care of file rotation.

sevdokimov commented 1 year ago

@sevdokimov Why are 2 loggers used?

What loggers do you mean?

@sevdokimov logback and log4j inside log-viewer-cli.

There is logback only in the release (in log-viewer/lib/* directory). The dependencies to org.apache.logging.log4j:log4j-api and org.apache.logging.log4j:log4j-core are optional and doesn't come to the build archive. They are used in com.logviewer.logLibs.log4j.Log4jConfigImporter only. Log4jConfigImporter is used when log-viewer is embedded to another application that uses log4J

sevdokimov commented 1 year ago

@sevdokimov logback and log4j inside log-viewer-cli.

Oh, you mean why src/main/resources/log4j2.xml exist? I don't know :) It is not used. I've removed it.

sevdokimov commented 1 year ago

@sevdokimov I mean that you need to configure saving the log to a file inside the application. For example, via logback. Because if you use the system saving of the log to a file, then users will still have to take care of file rotation.

Do you know what is the right directory to store logs? I'm afraid that 'log-viewer' directory may be read-only.

dima-bzz commented 1 year ago

@sevdokimov I think it's unlikely. And even if this happens, the user will know about it.

dima-bzz commented 1 year ago

@sevdokimov We can try and look at the feedback. I will add the log saving to the file.

sevdokimov commented 1 year ago

@sevdokimov We can try and look at the feedback. I will add the log saving to the file.

Ok. Don't forget to move src/main/resources/logback.xml outside the jar, a user should be able to modify it.

dima-bzz commented 1 year ago

@sevdokimov I will finalize the startup services tomorrow and add the log saving to the file.