Logging

  • 01 Aug

    Q&A 21: Generate a status file for each file which was successfully moved

    Q:  I need to know if a status file can be generated when a file is successfully moved that includes the source location?

    We would like a log file generated called 123456.pdf.log that contains the following data:

    Remote path: C:\upload\input\123456.pdf
    Affinity PDF has been transferred to distiller
    Delivery log name: C:\upload\output\123456.pdf.log

    The remote path is the location where the file was moved from
    The second line is just a text line
    The Delivery Log Name is the location where the file was placed and the name of the log file

    A: Yes this is possible using some Pascal Script.

    Let’s start with the Source. In our example it is a Windows Folder:

    ‘C:\Test\In_PDF\’.

    LimagitoX File Mover Windows Folder as Source

    Important, in the function Setup you need to set the ‘Destination Options’ to ‘Exit Cyclus on Error’. Reason is that we want to be 100% sure that the file was moved before we write the status file.

    LimagitoX File Mover Function Setup

    Destinations Setup, the first destination is the folder where the pdf needs to be moved to. The second destination is the ‘Pascal Script’ needed for the creation of the status file.

    LimagitoX File Mover Destinations

    We added a Windows folder as first Destination. Default Setup is ok.

    LimagitoX File Mover WIN as destination

    The second Destination is our ‘Pascal Script’ needed for the creation of the status file:

    Var
      tmpList: TStringList;
      tmpLogName: String;
      tmpLogPath: String;
    Const
      ctLogRootDir = 'C:\Test\Out\PDF';
    Begin
      tmpLogPath := ctLogRootDir + '%SFS\';
      psExitCode:= 1;
      // ... add your code here    
      tmpList := TStringList.Create;
      Try
        tmpLogName := '%SFN.log';
        Try    
          tmpList.Add('Remote path: %SFP%SFN'); 
          tmpList.Add('Affinity PDF has been transferred to distiller');
          tmpList.Add('Delivery log name: ' + tmpLogPath + tmpLogName);
          // Save
          psLogWrite(1, '', 'SaveToFile: ' + tmpLogPath + tmpLogName);
          tmpList.SaveToFile(tmpLogPath + tmpLogName);   
        Except
          psLogWrite(1, '', 'Log Create Error');
        End;  
      Finally
        tmpList.Free;
      End;  
    End.

    LimagitoX File Mover Pascal Script as Destination

    RunTime Log Result:

    Output Folder Result:

    If you need any help , please let us know.
    Regards,
    Limagito Team
  • 01 May

    How-To Delete old records from the Logging Database

    Dear users,

    Version v2019.5.1.0

    We got a request to delete old records from the File Mover Logging Database. We added ‘Qry Type’ as option to the existing ‘SQL as Source’ to achieve this.

    • Add SQL as Source

    • Set Database Vendor to ‘Use MSSQL Database’

    • Set the MSSQL Server settings of the Logging Database

    • Set Qry Type option to ‘Qry will NOT return data’. Adjust the amount of days you want to keep. At the example below it is set to delete records older than 100 days (adjust the -100 part).

    • Add a ‘dummy’ Pascal Script’ as Destination

    • Set a schedule so trigger this Rule

     

    Best regards,

    Limagito Team

    By Limagito-Team Logging , , , ,
  • 04 Mar

    How-To Use Logging to a SysLog Server

    Dear Users,

    We’ve added SysLog (UDP) as logging option to our File Mover (v2018.3.4.0). We’ve also reduced the amount of Log Levels to 4: “Error, Informational, Enhanced and Debug”. We strongly advice not to use the Debug log level in production.

    • SysLog Server Setup, this setup is common for all rules

    • Result of enabling the SysLog option

    Please let us know if you have any question/remark about this new option.

    Regards,

    Limagito Team

    By Limagito-Team Logging ,
1 2 3 4 5
SEARCH