Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Logging? #37

Closed
jmbell1989 opened this issue Jul 15, 2020 · 5 comments
Closed

Logging? #37

jmbell1989 opened this issue Jul 15, 2020 · 5 comments
Labels
enhancement New feature or request

Comments

@jmbell1989
Copy link

Hey, really like the work you've put it. Super easy and straightforward. I have a question though, is there a way to log the data that outputted to a file or something. I'd like to monitor these interactions. I saw there is a prof setting to monitor performance. Not sure if that's what I'm looking for or not but just dumping the output to a file would suffice.

Thanks for the help!

@benbullnz
Copy link

benbullnz commented Jul 15, 2020

Hey, I made this work by piping the console output to a log file. I know there is higher level logging available, someone else can talk to that.

In the meantime, kill your server and then restart rtsp-simple-server by running the following command:
./rtsp-simple-server |& tee server.log

This will create a server.log file in the same directory as rtsp-simple-server.

You can view the log file by running:
cat server.log
or//
tail -f server.log (this will continually update)

PS, i'm no expert so there might be a better way - but this worked for me.

@jmbell1989
Copy link
Author

I am unfortunately on Windows.. should've mentioned that:/ Thanks for the suggestion though. That will most definitely work in Linux

@aler9 aler9 added the enhancement New feature or request label Jul 19, 2020
@aler9
Copy link
Member

aler9 commented Jul 19, 2020

Hello, regarding monitoring, i think that two separate new features could be implemented:

  • an option to log to file instead than logging to stdout, expecially for Windows users that do not want to use console features
  • a metrics exporter, compatible with Prometheus, that provides via HTTP the number of connected clients, publishers, readers

Regarding pprof, i added it to monitor RAM and CPU usage; for instance, after enabling the option, you can get CPU

docker run --rm -it --network=host golang:1.14-alpine3.12 go tool pprof -text http://localhost:9999/debug/pprof/profile?seconds=30

or RAM

docker run --rm -it --network=host golang:1.14-alpine3.12 go tool pprof -text http://localhost:9999/debug/pprof/heap

aler9 added a commit that referenced this issue Jul 30, 2020
aler9 added a commit that referenced this issue Jul 30, 2020
@aler9
Copy link
Member

aler9 commented Jul 30, 2020

both features are available in v0.9.6.
Please look at the configuration file and the README for instructions on how to use both.

@aler9 aler9 closed this as completed Jul 30, 2020
@github-actions
Copy link
Contributor

github-actions bot commented Jan 1, 2023

This issue is being locked automatically because it has been closed for more than 6 months.
Please open a new issue in case you encounter a similar problem.

@github-actions github-actions bot locked and limited conversation to collaborators Jan 1, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants