Hi there,
This is the scenario we have.
We have multiple profiles that run on intervals sending emails containing the transfer logs however our userbase prefers to have a logfile generated and saved on a UNC path due to their workflow.
We need to have some way to generate a log when a profile successfully completes containing the list of files/folders transferred along with their files size ( basically what's in the email logs) but have that placed into a UNC path per profile (since it differs per profile).
Any assistance with this would be appreciated.
Need some assistance on creating custom logging directory per profile
-
- Posts: 1
- Joined: Tue Jul 11, 2023 7:25 pm
Re: Need some assistance on creating custom logging directory per profile
Hello,
in the latest Syncovery version, you can have the log file be copied to another path when a job has completed:
You can also do custom logging:
PascalScripts can be added to the profile via the Job tab sheet -> PascalScript.
Or globally via Program Settings dialog -> Advanced -> Global PascalScript.
in the latest Syncovery version, you can have the log file be copied to another path when a job has completed:
Code: Select all
function OnLogFileClosed(const FileName:UnicodeString):Boolean;
begin
FileCopy(FileName,'E:\Tests\'+ExtractFileName(FileName));
Result:=true;
end;
Code: Select all
const LogFolder='C:\Tests\Logs';
LogName='SyncoveryLog.csv';
function OnActionComplete(const StartTimeUTC, CompletionTimeUTC: Double;
const Success: Boolean;
const ActionStr, DirectionStr, Filename,
LeftFile, RightFile, Subfolder, MovedTo,
ErrorMsg: UnicodeString;
const ResultCode: Int64;
const ErrorSide: UnicodeString;
const ASize,ACompressedSize:Int64):Boolean;
var TF:Opaque;
begin
MakeSurePathExists(LogOrdner,false);
AtomicAppendTextFileLine(LogFolder+'\'+LogName,
DateToStr(Now)+';"'+Subfolder+'";"'+Filename+'";'+IntToStr(ASize));
Result:=true;
end;
Or globally via Program Settings dialog -> Advanced -> Global PascalScript.