3 Replies Latest reply: Jul 19, 2016 11:35 AM by Jonathan Dienst RSS

    Redirect logfile for a particular qvw

      In my qvw file, I have activated the following options:

      - Generate logfile

      - Timestamp in Logfile Name

      Once I deploy it on the server, all logs are generated in the same folder where the qvw file is contained.

      How can i change it?

      I'd wish to put in the folder ./logs


        • Redirect logfile for a particular qvw


          "On sucessful execution" of your task could trigger a batch file. The batch file moves/copies the log file to the desired folder


          • Re: Redirect logfile for a particular qvw
            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.



            • Re: Redirect logfile for a particular qvw
              Jonathan Dienst

              No way to do this directly in Qlikview. The previous suggestions are possible workarounds. You need to be sure that the qvb process has released the lock on the log file before copying.


              You could also schedule a batch/powershell job to sweep the log files daily into the log folder.