9 Replies Latest reply: Jul 19, 2016 11:29 AM by Stanislav Strogiy RSS

    LOGFILES

    Riad Kacim

      Hello,

       

      I want to know how to schedule a task in the QCM so i can transfer the logfile resulted after the daily reload of an application from the application folder to another folder.

       

      Cheers

        • Re: LOGFILES
          Gabor Tarnoczai

          Hi Riad,

           

          Open QMC and select tasks. Click on the new task button at the bottom of screen.

          The log files are in c:\ProgramData\Qlik\Log directory, every task create a script log, which is closely the same as you can see during a reload in Data Load Editor.

           

          G.

            • Re: LOGFILES
              Riad Kacim

              Thanks for your answer

               

              I can see the script you're talking about. My purpose is to create a file that contains this script every time a reload is done (a certain task is finished). and second step is to transfer this file from the folder whre it is created to another one that i will choose after

               

              Do you have any clue ?

                • Re: LOGFILES
                  Gabor Tarnoczai

                  Hi Riad,

                   

                  So the script log file name contains the application id, with this id you can specify, to which application belongs it.

                  It contains a timestamp as well, so you can specify which one is the newest.

                   

                  If I were you, I'll follow these steps:

                  • Disable the standard mode in order to have ability to execute batch files
                  • Create an application, that find and copy the associated log file with execute command (the command will be created dinamically through script).
                  • Create an other task with this new application, chained to the original application (task event trigger)

                   

                  G.

                    • Re: LOGFILES
                      Riad Kacim

                      Thanks for your help. I agree with your method but i don't know hot to do the three steps you mentionned before. How can i know if the standard mod has already been disabled or not ? How can i create such an application, is it a qlikview application ?

                       

                      I'm a little lost here..

                        • Re: LOGFILES
                          Gabor Tarnoczai

                          Hi Riad,

                           

                          It would be a QlikSense application (we are talking about QlikSense right?)

                           

                          • Standard mode :Editing an engine ‒ Qlik Sense check at QMC, or try load data with absolute path. If it works with absolute path, the standard mode is disabled (it is enabled default).
                          • Example for listing all files in a folder, you can add subfield function to get appid and timestamp:

                           

                          sub FileList (Root)

                                for each File in filelist (Root&'\*.*')

                           

                                   LOAD

                                      '$(File)' as Name,

                                   autogenerate 1;

                           

                                next File

                          end sub

                           

                          call FileList ('lib://MyData')

                           

                          After you selected the newest log in script you can concatenate a command and execute:

                          Execute 'Copy (or xcopy, robocopy) ' & '$(Log file full path)' 'c:\Destination'

                           

                          G.

                  • Re: LOGFILES
                    Stanislav Strogiy

                    1. Trigger on end of reload in self-application, that run macro:

                         Sub RunCMDComand

                         CMDCommand = ActiveDocument.Variables("RunCMD").GetContent.String

                         set objShell = CreateObject("WScript.Shell")

                         objShell.run CMDCommand,0,true

                         end sub

                    2. Make variable RunCMD like this:

                         ='CMD /C MOVE ' & SubField(DocumentPath(), '.', 1) & '*.log ' & Replace(DocumentPath(), DocumentName(), 'Log')

                    3. Be alerted that you MUST CREATE FOLDER "Log" in the folder that .QVW is in.

                     

                    Macro would run after App is reloaded in full-client app either by server.

                     

                    Cheers and fo to HELL with batch files.