Move the Appserver Log Files

Hi all,

Trying to move the Appserver Log files to a different folder on a different drive. Modified the nlog.config file specified <variable name="logBaseDir" value="d:/logfiles/App_Data/Logs"/>. File gets created and logs information. All good. However when I try to access the file using the AppServer Web Gui (https://FQDN_of_server/AppServer/#/logs), and I click on LOGS, I do not see any information. When I go back to explorer and open the file there, I see the following errors being logged:

2022-12-14 19:15:30.8616 INFO (Indexing ) : Index optimization done in 0 seconds.
2022-12-14 19:17:31.5624 INFO (AppServer ) : Using certificate provider: ThumbPrintCertificateProvider
2022-12-14 19:17:31.5624 INFO (AppServer ) : Using session certificate: C6DF0CA299A932E247DC708D0096F5022EC7D220
2022-12-14 19:17:31.8593 INFO (Indexing ) : Initializing search index in C:\inetpub\wwwroot\AppServer\App_Data\SearchIndex
2022-12-14 19:17:32.0468 INFO (Indexing ) : Index state in C:\inetpub\wwwroot\AppServer\App_Data\SearchIndex = Okay
2022-12-14 19:17:32.1874 INFO (ObjectLog 0860cc40-0c28-479b-a314-0dfb93c2a6de) : User Indexing Account (Dialog user: sa, X fields: sa) authenticated.
2022-12-14 19:17:32.2187 INFO (AppServer ) : Creating performance counters in category One Identity Manager Application Server, instance /AppServer
2022-12-14 19:17:32.2187 INFO (AppServer ) : Performance counters initialized in category One Identity Manager Application Server, instance /AppServer
2022-12-14 19:17:32.2499 INFO (WebLog Updater) : Checking for updates.
2022-12-14 19:17:32.2656 INFO (WebLog Updater) : AutoUpdate: All files are up-to-date
2022-12-14 19:17:32.3906 INFO (AppServer ) : Could not find authentication data for session JCYU7yX4nYUuHK3FIhy6, it may have expired.
2022-12-14 19:17:38.3751 INFO (Indexing ) : Index optimization done in 0 seconds.
2022-12-14 19:17:56.0943 INFO (ObjectLog fa8759b6-3966-49f6-bfde-01742492e0cb) : User Stadelmann, Andreas (Dialog user: CCCAdmin, X fields: P0021132) authenticated.
2022-12-14 19:17:58.2662 WARN (AppServer ) : Tried to get unknown log file: "D:\Logfiles\Appserver\Logs\AppServer.log"
2022-12-14 19:17:58.2819 ERROR (ObjectLog fa8759b6-3966-49f6-bfde-01742492e0cb) : [ServiceStack.HttpError] Log file was not found.
ServiceStack.HttpError: Log file was not found.
at QBM.AppServer.Plugins.LogViewer.LogViewerService.Get(LogContentRequest request)
at ServiceStack.Host.ServiceRunner`1.<ExecuteAsync>d__15.MoveNext() in C:\BuildAgent\work\3481147c480f4a2f\src\ServiceStack\Host\ServiceRunner.cs:line 136 at QBM.AppServer.Plugins.LogViewer.LogViewerService.Get(LogContentRequest request)
at ServiceStack.Host.ServiceRunner`1.<ExecuteAsync>d__15.MoveNext() in C:\BuildAgent\work\3481147c480f4a2f\src\ServiceStack\Host\ServiceRunner.cs:line 136

I have change everything back to the default, but now not event this is working: 

2-12-14 19:30:59.0379 INFO (Indexing ) : Index optimization done in 0.0156228 seconds.
2022-12-14 19:32:38.7851 INFO (WebLog Updater) : Checking for updates.
2022-12-14 19:32:38.7851 INFO (WebLog Updater) : AutoUpdate: All files are up-to-date
2022-12-14 19:33:02.2076 INFO (Indexing ) : Index optimization done in 0 seconds.
2022-12-14 19:35:04.1286 INFO (Indexing ) : Index optimization done in 0 seconds.
2022-12-14 19:36:02.6224 INFO (AppServer ) : Could not find authentication data for session 0gpsH6QqvFOw0z2Qv2AU, it may have expired.

2022-12-14 19:36:10.6695 WARN (AppServer ) : Tried to get unknown log file: "C:\inetpub\wwwroot\AppServer\App_Data\Logs\AppServer.log"
2022-12-14 19:36:10.6695 ERROR (ObjectLog 1e7b06f9-1bfa-415f-b1da-0f204bf80ad7) : [ServiceStack.HttpError] Log file was not found.
ServiceStack.HttpError: Log file was not found.
at QBM.AppServer.Plugins.LogViewer.LogViewerService.Get(LogContentRequest request)
at ServiceStack.Host.ServiceRunner`1.<ExecuteAsync>d__15.MoveNext() in C:\BuildAgent\work\3481147c480f4a2f\src\ServiceStack\Host\ServiceRunner.cs:line 136 at QBM.AppServer.Plugins.LogViewer.LogViewerService.Get(LogContentRequest request)
at ServiceStack.Host.ServiceRunner`1.<ExecuteAsync>d__15.MoveNext() in C:\BuildAgent\work\3481147c480f4a2f\src\ServiceStack\Host\ServiceRunner.cs:line 136
2022-12-14 19:37:05.8194 INFO (Indexing ) : Index optimization done in 0 seconds.

Anyone knows how to make the Appserver app to display the log file again other then reinstalling the appserver in the appserver url? Or even better anyone know how the log file can be moved?

Regards, Andy

Parents
  • What version of OneIM are you using?

    Did you check that the file is present here "C:\inetpub\wwwroot\AppServer\App_Data\Logs\AppServer.log"?

    If it is present, did you check the permissions? (That might be the reason for the first error as well). If you move the log file, you have to ensure that the Application Server is able to read and write in that location.

  • Hi Markus

    Thanks for your reply. The files get created automatically by the Appserver in the new log destination and as you can see infos are also being logged correctly in the log files. But of course I have checked the presence of the file and compared and adjusted the NTFS permissions  on the folder and files. This was the first thought I had myself when I was troubleshooting this yesterday. I have even gone further and applied more permissions as in the default Log folder. Unfortunately, this does not make a difference. The Warning and the Error entries are only being written to the log file, when I go into the Appserver URL trying to read the logs from in there. I have also changed the account the Appserver_Pool is using and granted this account Full Access pemissions. 

    We are running version 8.2.1. 

    Regards

    Andy

  • I did a little digging...

    You need to configure the base log directory in the web.config for the log viewer.

     <logviewer>
        <!-- Configure the log viewer -->
    
        <!-- Switch log viewer off -->
        <!--<add key="off" value="true"/>-->
    
        <!-- Set base dir of log files that are valid to deliver, default: <Root>/App_Data/Logs -->
        <!--<add key="basedir" value=""/>-->
      </logviewer
    


  • Hi Markus

    Tried that also last night. Did not make a difference. In fact it did not even read this. I had to make the change in the nlog.config.<variable name="logBaseDir" value="d:/logfiles/App_Data/Logs"/>.

    Maybe I need to restart the server.

    Regards

    Andy

  • I was able to move the log file using version 9.1 (sorry, I do not have version 8.2.1 available currently).

    I changef the nlog.config and the web.config to move the logfiles and to be able to display them in the App Server Dashboard.

    nlog.config

    <variable name="logBaseDir" value="C:/Logfiles/App_Data/Logs"/>

    web.config

    <logviewer>
        <add key="basedir" value="C:/Logfiles/App_Data/Logs"/>
    </logviewer>

    HTH

  • I can confirm that is working also on 8.2.1

Reply Children
  • Thank you Marek and Markus. I never specified the exact path in bot config files. My error was, that I change it in web.config to 

    <logviewer>
    <add key="basedir" value="C:/Logfiles"/>
    </logviewer>

    I thought this would replace the default variable (basedir) used in nlog.config. I was not aware that both entries must be the same. I have changed them to the exact location and now it is working also. 

    Thanks again and enjoy the rest of the week.

    Regards, Andy