Skip to content

bug: Multiprocess cannot write log to the same file #1056

Closed
@nguyenhoangthuan99

Description

@nguyenhoangthuan99

Problem
In windows, once a file is taken by one process, other process can not modify it. For example, when the server is writing to log file, it hold cortex.log, and if we run CLI command, it cannot write message to cortex.log.

Solution
In window, we are planning to use Unix Domain Socket to start a thread and write log to file. Below are detail implementation:

  • When start server, will create a thread to run UDS to listen messages and write to logfile.
  • From server side, override log method of Trantor to send log message to UDS server
  • From CLI side, when execute command, check if UDS server is live, if not write directly log to log file.
  • With command has --verbose flag, log everything to terminal.

Metadata

Metadata

Labels

Type

No type

Projects

Status

Completed

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions