How to change the logFileLocation to a different system folder?

Add-in Express™ Support Service
That's what is more important than anything else

How to change the logFileLocation to a different system folder?
 
EnterpriseDev


Guest


I know the default location is C:\users\{username}\Documents\Add-in Express\adxloader.log. But..

1. How do I change this to C:\users\{username}\Documents\MyAddin\adxloader.log?
I am unsure what I exactly should write in the manifest file. "<logFileLocation>{Documents}\MyAddin\adxloader.log</logFileLocation>" does not seem to work.

2. Is there any other folder you would recommend storing these logs to instead where it is guaranteed that the user has write access to?
So for example, C:\Users\{username}\AppData\Local\MyAddin sounds like a good suggestion. However, I do not know how I specify such a path in the logFileLocation that include a dynamic "username". I guess it is easier for the user to find the log file in the Documents folder but I do think it is not the right location for log files that should never be have to be read by the end-user. Therefore, I think AppData Local might be a more appropriate location for such logs.
Posted 19 Jul, 2016 10:42:13 Top
Andrei Smolin


Add-in Express team


Posts: 18829
Joined: 2006-05-11
Hello (what is your name, please?)

#1. Below is what works for me:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <assemblyIdentity name="MyAddin103, PublicKeyToken=797280915322d75c" imageRuntimeVersion="v4.0.30319" />
  <loaderSettings generateLogFile="true" shadowCopyEnabled="false" privileges="administrator" minOfficeVersionSupported="12">
    <logFileLocation>%MyDocumentsFolder%My Add-inMyLog.txt</logFileLocation>
  </loaderSettings>  
</configuration>


#2. Use %LocalAppDataFolder%. Also, check section "Get details about add-in registration/unregistration"; see the PDF file in the folder {Add-in Express}\Docs on your development PC.


Andrei Smolin
Add-in Express Team Leader
Posted 20 Jul, 2016 02:44:29 Top
EnterpriseDev


Guest


Thank you so much. I missed that part in the documentation. I was reading the section "Add-in Express Loader Manifest" but missed the section "Get details about add-in registration/unregistration"
Posted 20 Jul, 2016 02:54:11 Top
Andrei Smolin


Add-in Express team


Posts: 18829
Joined: 2006-05-11
I believe this is a bug in the text of the manual ))


Andrei Smolin
Add-in Express Team Leader
Posted 20 Jul, 2016 03:01:57 Top
EnterpriseDev


Guest


I have tried multiple times to change the location now of the log files without any success, I keep getting the Add-in Express folder under My Documents. I want to change both adxregistrator.log and adxloader.log so that they are stored in a different folder (%LocalAppDataFolder%/MyApp/). I edited the adxloader.dll.manifest in the Loader directory. Have tried many types of values such as "<logFileLocation>C:\MyLog.txt</logFileLocation>", "<logFileLocation>%LocalAppDataFolder%\MyAddin\</logFileLocation>" or "<logFileLocation>%LocalAppDataFolder%\MyAddin\MyLogFile.txt</logFileLocation>", but none are working. Am I missing something?
Posted 21 Jul, 2016 18:19:23 Top
Andrei Smolin


Add-in Express team


Posts: 18829
Joined: 2006-05-11
Make sure your manifest follows this structure:

<loaderSettings ...> 
    <logFileLocation>...</logFileLocation> 
</loaderSettings>



Andrei Smolin
Add-in Express Team Leader
Posted 22 Jul, 2016 04:31:10 Top
EnterpriseDev


Guest


Thank you. That did it for the adxloader.log location. For the adxregistrator.log location I had to modify the parameters to the register in the WIX code for both the installation and uninstallation custom actions to include:
/privileges=admin /log=&quot;%LocalAppDataFolder%MyAddin/adxregistrator.log&quot;" (ref: https://www.add-in-express.com/forum/read.php?FID=5&TID=8856)
Posted 22 Jul, 2016 05:22:11 Top
Andrei Smolin


Add-in Express team


Posts: 18829
Joined: 2006-05-11
You are welcome!


Andrei Smolin
Add-in Express Team Leader
Posted 22 Jul, 2016 05:35:39 Top