Closed fleischsalatinspace closed 2 years ago
It appears this is an issue with the dockerization of the app, those running it on baremetal have reported that logging works fine. Transferring to pathfinder-containers project.
@samoneilll It is an issue with dockerization in that the websocket reliably works in the container, but logging via the socket seems to not.
If you comment out the bit that tries to log via socket, and only log via file, it works
// update map history *.log files -----------------------------------------------------------------------------
if($this->isHistoryLogEnabled()){
// check socket config
//if(Config::validSocketConnect(Config::getSocketUri())){
// $log->addHandler('socket', 'json', $this->getSocketConfig());
//}else{
// update log file local (slow)
$log->addHandler('stream', 'json', $this->getStreamConfig());
//}
}
nice find @JorisBolsens . Is there any known downside in disabling the map history logging via sockets? Do you have an productive instance where you are already using this? Any performance impact?
I am using this for a fairly small pathfinder install, I have not seen any performance degradation by running it this way. I have been looking into the websocket implementation to try and understand how the socket log is supposed to work, but my grasp of php is rudimentary at best.
Hi @JorisBolsens, thanks for looking into this. Your discovery of the logic to log via file/socket was actually useful and after investigating I found that logs are actually being created inside the socket container as json at /var/www/html/pathfinder/history/map/
in the format map_{map_id}.log
.
I think we can actually solve this by just mounting a directory from the host at this binding so that logs are persisted to host's filesystem. Maybe it's even worth setting up logrotate in the socket container to do some rotation and archiving.
I've created a new branch that I hope fixes logging:
https://github.com/goryn-clade/pathfinder-containers/pull/38/files
Enabling map history logging via pathfinder.ini or UI does not work. No map logs displayed in UI or written to file
Confirmed by sam on slack