terra-sync / cnc

Seamless Database Replication tool
GNU General Public License v3.0
4 stars 2 forks source link

Enhance Output Handling by Piping STDOUT/STDERR to a File #46

Closed charmitro closed 4 months ago

charmitro commented 4 months ago

Description

Currently, our application captures the STDOUT/STDERR of a subprocess directly into a buffer, which is then processed and used within the application, such as for constructing an email body. This method, while effective, has its limitations in terms of scalability and efficiency, especially when dealing with large amounts of output data. To improve upon this, we propose to enhance our output handling mechanism by piping the STDOUT/STDERR of subprocesses directly to a file. This approach will not only help in managing large output more effectively but also simplify the process of logging and debugging.

Expected Benefits

Proposed Changes

Potential Challenges

panosfol commented 4 months ago

@charmitro What should the default path for creating the .log file be? Is home/user/ ok? And how could the user customize the path?

charmitro commented 4 months ago

@charmitro What should the default path for creating the .log file be? Is home/user/ ok? And how could the user customize the path?

/var/log/ or /var/log/cnc/ or user-specified.

panosfol commented 4 months ago

We can't create the cnc folder from our side though, should we leave that up to the user to set it up? And if we want the user to specify it, should it be a field in our config that the user specifies the path to keep the logs?

charmitro commented 4 months ago

We can't create the cnc folder from our side though, should we leave that up to the user to set it up?

If the directory doesn't exist, we create it

And if we want the user to specify it, should it be a field in our config that the user specifies the path to keep the logs?

Yes, a config field.

charmitro commented 4 months ago

@charmitro What should the default path for creating the .log file be? Is home/user/ ok? And how could the user customize the path?

/var/log/ or /var/log/cnc/ or user-specified.

@panosfol and ofcourse, $HOME/ if left unspecified and no superuser rights. So in total,

  1. /var/log/cnc/
  2. $HOME/ if /var/log/cnc fails due to superuser rights
  3. User-specified under
    [general]
    log_location = a/path/here