FISH-10120 collect logs from a remote ssh instance #60
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I have revamped the
LogCollector
class so it utilises the commandcollect-log-files
.What the command does is it collects the log files from local or remote instances and stores it in a zip file in payara5/glassfish/domains/domain1/collected-logs. The LogCollector then uses the command output to determine the location of the file and unzips the file and copies into the respective folder.
It creates the log folders accordingly depending if there is an instance or not.
If a target is used (
./asadmin collect-diagnostics --target instance
) then it will use the target and attach it to theprogramOptions
which is then used for the command.I have also added some error handling on the
CollectorService
as if there are no instances it should still collect the logs for the server. A few bits of code has been commented out as I will need it for the next task which is to allow heap dump collection of SSH instances.