Logging changes when processing TIC files

This commit is contained in:
Deon George 2023-09-08 21:11:53 +10:00
parent 6d199345ac
commit 67c1be209d
4 changed files with 10 additions and 10 deletions

View File

@ -144,7 +144,7 @@ class Tic extends FTNBase
*/ */
public function load(string $filename): void public function load(string $filename): void
{ {
Log::info(sprintf('%s:Processing TIC file [%s]',self::LOGKEY,$filename)); Log::info(sprintf('%s:+ Processing TIC file [%s]',self::LOGKEY,$filename));
if (str_contains($filename,'-')) { if (str_contains($filename,'-')) {
list($hex,$name) = explode('-',$filename); list($hex,$name) = explode('-',$filename);
@ -154,10 +154,10 @@ class Tic extends FTNBase
} }
if (! file_exists($filename)) if (! file_exists($filename))
throw new FileNotFoundException(sprintf('%s:File [%s] doesnt exist',self::LOGKEY,$filename)); throw new FileNotFoundException(sprintf('File [%s] doesnt exist',$filename));
if (! is_readable($filename)) if (! is_readable($filename))
throw new UnableToWriteFile(sprintf('%s:File [%s] is not readable',self::LOGKEY,realpath($filename))); throw new UnableToWriteFile(sprintf('File [%s] is not readable',realpath($filename)));
$f = fopen($filename,'rb'); $f = fopen($filename,'rb');
if (! $f) { if (! $f) {

View File

@ -59,7 +59,7 @@ class TicProcess implements ShouldQueue
$to = new Tic; $to = new Tic;
$to->load(storage_path('app').'/'.$this->file); $to->load(storage_path('app').'/'.$this->file);
Log::info(sprintf('%s:Processed [%s] storing [%s] as id [%d]',self::LOGKEY,$this->file,$to->fo->name,$to->fo->id)); Log::info(sprintf('%s:= Processed [%s] storing [%s] as id [%d]',self::LOGKEY,$this->file,$to->fo->name,$to->fo->id));
unlink(storage_path('app').'/'.$this->file); unlink(storage_path('app').'/'.$this->file);

View File

@ -109,11 +109,11 @@ final class Echomail extends Model implements Packet
if ($exportto->count()) { if ($exportto->count()) {
if ($model->no_export) { if ($model->no_export) {
Log::debug(sprintf('%s:- NOT processing exporting of message by configuration [%s] to [%s]',self::LOGKEY,$model->id,$exportto->join(','))); Log::alert(sprintf('%s:- NOT processing exporting of message by configuration [%s] to [%s]',self::LOGKEY,$model->id,$exportto->join(',')));
return; return;
} }
Log::debug(sprintf('%s:- Exporting message [%s] to [%s]',self::LOGKEY,$model->id,$exportto->join(','))); Log::info(sprintf('%s:- Exporting message [%s] to [%s]',self::LOGKEY,$model->id,$exportto->join(',')));
// Save the seenby for the exported systems // Save the seenby for the exported systems
$model->seenby()->syncWithPivotValues($exportto,['export_at'=>Carbon::now()],FALSE); $model->seenby()->syncWithPivotValues($exportto,['export_at'=>Carbon::now()],FALSE);
@ -165,7 +165,7 @@ final class Echomail extends Model implements Packet
*/ */
public function packet(Address $ao): Message public function packet(Address $ao): Message
{ {
Log::debug(sprintf('%s:+ Bundling [%s]',self::LOGKEY,$this->id)); Log::info(sprintf('%s:+ Bundling [%s]',self::LOGKEY,$this->id));
// @todo Dont bundle mail to nodes that have been disabled, or addresses that have been deleted // @todo Dont bundle mail to nodes that have been disabled, or addresses that have been deleted
$o = new Message; $o = new Message;

View File

@ -56,7 +56,7 @@ class File extends Model
parent::boot(); parent::boot();
static::creating(function($model) { static::creating(function($model) {
Log::debug(sprintf('%s:- Storing file [%s] in [%s]',self::LOGKEY,$model->fullname,$model->full_storage_path)); Log::info(sprintf('%s:- Storing file [%s] in [%s]',self::LOGKEY,$model->fullname,$model->full_storage_path));
// Store file // Store file
if (Storage::put($model->full_storage_path,Storage::disk('local')->get($model->fullname),'public')) { if (Storage::put($model->full_storage_path,Storage::disk('local')->get($model->fullname),'public')) {
@ -122,11 +122,11 @@ class File extends Model
if ($exportto->count()) { if ($exportto->count()) {
if ($model->no_export) { if ($model->no_export) {
Log::debug(sprintf('%s:- NOT processing exporting of message by configuration [%s] to [%s]',self::LOGKEY,$model->id,$exportto->join(','))); Log::alert(sprintf('%s:- NOT processing exporting of message by configuration [%s] to [%s]',self::LOGKEY,$model->id,$exportto->join(',')));
return; return;
} }
Log::debug(sprintf('%s:- Exporting file [%s] to [%s]',self::LOGKEY,$model->id,$exportto->join(','))); Log::info(sprintf('%s:- Exporting file [%s] to [%s]',self::LOGKEY,$model->id,$exportto->join(',')));
// Save the seenby for the exported systems // Save the seenby for the exported systems
$model->seenby()->syncWithPivotValues($exportto,['export_at'=>Carbon::now()],FALSE); $model->seenby()->syncWithPivotValues($exportto,['export_at'=>Carbon::now()],FALSE);