Create a log file for each process in multi threaded environment #3485
Answered
by
tt4g
Kubendranath
asked this question in
Q&A
-
|
Is it possible to write logs to different files for each process from a single point of initialization which can be further scalable dynamically if more process are added in future .. |
Beta Was this translation helpful? Give feedback.
Answered by
tt4g
Nov 7, 2025
Replies: 1 comment 4 replies
-
|
This can be achieved by including the PID in the log file name. |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is what's referred to as a "file" here actually a process?
If so, it's not possible.
This is because accessing another process's memory is unsafe.
If Process A writes to Process B's memory while Process B is accessing the same memory, the data will be corrupted.
Consider exchanging log data between processes so that each process can access log files using i…