Get logs from a service
See original GitHub issueHello,
I have been trying in vain to obtain logs from a service through the client code. I can retrieve the logs from my service via CURL on the command line (curl http://localhost:2375/services/my-service-name/logs?stdout=true --output -
) but via the docker-java client I am unable to do so. My code is:
StringBuilder sb = new StringBuilder();
dockerClient.logServiceCmd(serviceName)
.withStdout(true)
.exec(new ResultCallback.Adapter<>() {
@Override
public void onNext(Frame frame)
{
sb.append(new String(frame.getPayload()));
}
}).awaitCompletion();
return sb.toString();
Any help would be much appreciated. Are there any docs indicating how this should be done as I could not find any?
Thanks Jay
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
How to see full log from systemctl status service?
Just use the journalctl command, as in: journalctl -u service-name.service. Or, to see only log messages for the current boot:
Read more >Are there any log file about Windows Services Status?
Through the Computer management console, navigate through Event Viewer > Windows Logs > System. Every services that change state will ...
Read more >Managing Services from the Command Line and Viewing ...
Log files are accessible through Windows Event Viewer. Configuration files are accessible at: %plesk_dir%dns. MySQL. To stop the service through command line:.
Read more >How to get logs from all pods of a service in a cluster?
Send logs to Elasticsearch, and query the logs through Kibana. But this way requires the deployment and integration with ELK, and if you...
Read more >Service Logs - Oracle Help Center
You can enable service logs for some resources. Service logs provide diagnostic information about the resources in your tenancy. When you enable logging...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@bsideup I could add a test but, as I’m new to the project, some advice on where to put it would be appreciated.
I still think adding some documentation for inclusion on the README would be of benefit for new users.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.