question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Get logs from a service

See original GitHub issue

Hello,

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:closed
  • Created 3 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
qoobiccommented, Jul 6, 2020

@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.

0reactions
stale[bot]commented, Aug 5, 2020

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found