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.
The collection of Java logging from agents is rather antiquated given the prevalence of
Cloud
s and is missing a lot of critical diagnostics. (CloudBees-internal reference: BEE-46766) Some draft observations:SlaveLogs
only lists information from currently online agents. It might be more useful to run something likeJenkinsRule.RemoteLogDumper
to stream agent JUL messages back to a file on the controller, so we could collect these at any time for support bundles, including agents currently defined but disconnected, or agents which have since been deleted. Most agent logs are brief (9aeca36 notwithstanding) so this does not seem unreasonable. Could still collectremoting.log
from the agent when-workDir
is defined, as this would capture messages about connection attempts before the agent is fully online.SlaveLogs.addAgentJulLogRecords
does not seem to work well. It stores the logs on the agent, making it impossible to retrieve them if the agent is not currently online, begging the question of why this method even exists (sinceSlaveLogs
also usesComputer.getLogRecords
which has the same information). Also the logs are stored in the root path, rather than using the workdir when one is defined.Even for an agent currently connected it is not that helpful since it relies on
SupportPlugin.LogInitializer
capturing JUL records from the agent JVM afterComputerListener.onOnline
, whereasremoting/logs/remoting.log.0
inside the workdir includes all the details of the connection logic starting fromhudson.remoting.jnlp.Main.createEngine
up throughhudson.remoting.jnlp.Main$CuiListener.status
sayingConnected
.SmartLogCleaner
is deliberately deleting information about historical agents.I would expect custom loggers at fine levels defined on the controller to be honored inside the agent JVM as well, as
log-cli
does.NodeRemoteDirectoryComponent
would includeremoting.log.0
but this is not exactly apparent, and only available for one agent at a time by selecting Agent Support.(Extracted from #517 for clarity.)