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

Please add example for logging across different machines over a network. #30

Open
sahilmtayade opened this issue Jun 26, 2024 · 1 comment

Comments

@sahilmtayade
Copy link

Given that multiprocessing logging starts a log server, I would like to be able to have code running on multiple machines and one machine runs the log server. I'm not sure how to do this with this library.

@Dragon2fly
Copy link
Owner

Dragon2fly commented Jun 27, 2024

Hi @sahilmtayade

You could refer #26 as @ZeroRin has figured out a way to achieve this.

On logger machine, start with use_multiprocessing=True, port=PortNumber as usual. On the worker machines, add one more argument of host=“Logger machine hostname or ip”. Also, using string --multiprocessing-fork as the first sys.argv value for these worker scripts. You could either pass that string to command line that starts the script or put sys.argv[1]=“--multiprocessing-fork” before setup_logging().

It should be simpler at the next release version, but for now, this is the way to do it.

If you still need help, please describe a little more about your use case.

Have a good day

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants