Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Log File Path #298

Open
BenderNETs opened this issue Sep 19, 2023 · 24 comments
Open

Log File Path #298

BenderNETs opened this issue Sep 19, 2023 · 24 comments

Comments

@BenderNETs
Copy link

I recently moved a website including the store to a different web server. The files of the website are now located in a different location. For some reason I receive an exception when I click on the product details. The exception actually happens saying it can't find the log file showing the old local path. Now I need to change the storeLog file location.
Where is the path information stored for the storeLog file?

@DNNMonster
Copy link
Collaborator

Is this the OS xml debugging log files or related to log4net?

A few simple steps you likely already took but just to make sure... Clear the site cache? Restart the application...? Increment the CRM version...? If you think it's OS specific then can go into the BO and you will find the debug mode enabled and outputting file settings that you might try toggling... Just to see if it changes things.

You may also want to search the OS repo for the OutputDebugFile function to see a few places files where there are files being generated. I am pretty sure OS is not managing the actual root path but just concatenating a string to the DNN instance's home directory.

If none of that is helpful you may need to share more details about the error to see if something jumps out.

@BenderNETs
Copy link
Author

This is the exception. It already fails writing to the log file. The drive changed from d drive to c drive. That's my problem now. Where is that path to the storeLog.txt saved? Is it in a config file or db stored?

System.IO.DirectoryNotFoundException: Could not find a part of the path 'D:\inetpub\wwwroot\DNN\Portals_default\Logs\storeLog.txt'. at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost) at System.IO.StreamWriter.CreateFile(String path, Boolean append, Boolean checkHost) at System.IO.StreamWriter..ctor(String path, Boolean append, Encoding encoding, Int32 bufferSize, Boolean checkHost) at System.IO.StreamWriter..ctor(String path) at Nevoweb.DNN.NBrightBuy.Components.ProductUtils.GetProductData(Int32 productId, Int32 portalId, String lang, Boolean hydrateLists, String typeCode) at Nevoweb.DNN.NBrightBuy.Components.ProductUtils.GetProductData(Int32 productId, String lang, Boolean hydrateLists, String typeCode) at Nevoweb.DNN.NBrightBuy.ProductAjaxView.RazorDisplayDataEntry(String entryId) at Nevoweb.DNN.NBrightBuy.ProductAjaxView.RazorPageLoad() at Nevoweb.DNN.NBrightBuy.ProductAjaxView.OnLoad(EventArgs e)

@DNNMonster
Copy link
Collaborator

I am not sure about that filename..?? It looks like the standard location for the log4net files generated by DNN, but it seems to have a missing backslash in the path shown in the error message. You may want to check your DotNetNuke.log4net.config and make sure the file element value is right. It may not fix the issue but it's worth a look before chasing anything else.

<file value="Portals/_default/Logs/" />

@BenderNETs
Copy link
Author

This is how it shows in DotNetNuke.log4net.config
However, the store tries to log under 'D:\inetpub\wwwroot\DNN\Portals_default\Logs\storeLog.txt', but there is no D drive. Previously the website was hosted on D drive, but after the move it's no located on C drive.
The question is: where is the info stored with the wrong drive letter? Is it coming from any store configuration?

@jasclar
Copy link

jasclar commented Sep 20, 2023

look in [dbo].[NBrightBuy] table for an entry with GUIDKey = NBrightBuySettings
then in the xmldata check the rootmappath

@BenderNETs
Copy link
Author

I already checked it and a change from d to c drive didn't help. I cleared the cache, restarted DNN, even recycled the app pool, but nothing changed. Still the same exception with the d drive path.

C:\inetpub\wwwroot\DNN</rootmappath>

@DNNMonster
Copy link
Collaborator

I think it may still be a log4net configuration issue but I'm not sure why it's still showing the D drive unless it's hardcoded some place in a config file. You might share your DotNetNuke.log4net.config if your alright with it otherwise take a look at how this posting shows the usage of static log file naming just to make sure nothing looks amiss. It's not exactly a match to the error you have but potentially relative. It would be worth testing a path with the drive letter specified and see if the error goes away.

https://stackoverflow.com/questions/18063073/how-to-configure-static-log-file-name-with-compositely-named-roll-backups

@BenderNETs
Copy link
Author

<?xml version="1.0" encoding="utf-8" ?> <log4net> <appender name="RollingFile" type="log4net.Appender.RollingFileAppender"> <file value="Portals/_default/Logs/" /> <datePattern value="yyyy.MM.dd'.log.resources'" /> <rollingStyle value="Date" /> <staticLogFileName value="false" /> <appendToFile value="true" /> <maximumFileSize value="10MB" /> <maxSizeRollBackups value="5" /> <lockingModel type="log4net.Appender.FileAppender+MinimalLock"/> <layout type="log4net.Layout.PatternLayout"> <conversionPattern value="%d{yyyy-MM-dd HH:mm:ss.fffzzz} [%property{log4net:HostName}][C:%property{appdomain}][T:%thread][%level] %logger - %m%n" /> </layout> </appender> <root> <level value="Error" /> <appender-ref ref="RollingFile" /> </root> </log4net>

@BenderNETs
Copy link
Author

changed to
<file value="C:\inetpub\wwwroot\DNN\Portals\_default\Logs\" />
no luck, still the same exception showing the D drive in the path which does not exist.

@BenderNETs
Copy link
Author

I think the DotNetNuke.log4net.config is correct as I showed earlier since I do see the default DNN logs being created with the file name shown as mentioned in the datePattern. I do see one log file named storeLog.txt in the same folder created and last updated before I moved to the new location. After the move nothing gets saved in that store log file.

@DNNMonster
Copy link
Collaborator

DNNMonster commented Sep 22, 2023

Maybe permissions..? You might double check that. I'd create the directory if it's not there. Heck maybe the file too.

Maybe another config? Can you find a ref to storeLog.txt some place?

You could try dumping the pertinent vars to your template to see if one is bogus...

@BenderNETs
Copy link
Author

BenderNETs commented Sep 22, 2023

looked all over. Did a search on the filename in all files. Couldn't find any config with a value of "storeLog.txt"
DNN logs work (can see files created every day).
The only path that I could find related to the shop was in the database (Table NBrightBuy - GUIDKey: "NBrightBuySettings")

<rootmappath>C:\inetpub\wwwroot\DNN\</rootmappath>

I updated the rootmappath in the XMLData from D to C and I can see the correct path after re-querying.

Permissions are all good. Running out of ideas :(

@DNNMonster
Copy link
Collaborator

Any plugins? Search your repos too.

@jasclar
Copy link

jasclar commented Sep 23, 2023

Have you checked Settings -> Server Settings -> Performance ? ... increment version, switch off minification and composite files. Try with no caching? Is this a child portal?
Also running out of ideas

@BenderNETs
Copy link
Author

Tried all options, no luck. This is not a child portal. Only one portal installed.
The only plugin installed is "OS_PayPal Payment"

@jasclar
Copy link

jasclar commented Sep 23, 2023

Is there anything relevant in your IIS settings, either at the site or the server level, e.g. in Application Settings ??
And have you definitely carefully checked all your .config files in all folders and subfolders, not just the DotNetNuke.log4net.config file at the site top level?
(Really struggling to think of anywhere else this would be set)

@jasclar
Copy link

jasclar commented Sep 23, 2023

Have you tried setting the value to the full path where you have this...

@jasclar
Copy link

jasclar commented Sep 23, 2023

<file value="Portals/_default/Logs/" />

@BenderNETs
Copy link
Author

BenderNETs commented Sep 23, 2023

The previous server was a Windows Server 2016 (SQL Server Express 2016), moved to Windows Server 2022 (SQL Server Express 2022).
I checked all files within the complete DNN folder for "storeLog.txt" through text editor with option "Search in all files". Couldn't find anything. Already tried to change to the full path C:\inetpub\wwwroot\DNN\Portals\_default\Logs\ in both log4net configs (C:\inetpub\wwwroot\DNN\DotNetNuke.log4net.config and C:\inetpub\wwwroot\DNN\Config\DotNetNuke.log4net.config), still no luck

@BenderNETs
Copy link
Author

Two things:

  1. The log is obviously coming from the online store (storeLog.txt). Any idea where the store configures the log settings? The log4net settings are correct since I do see other log files stored under "Portals/_default/Logs/"
  2. The actual problem is when I try to click on a product to get to the details (see exception I posted earlier). Is the online store always logging this on the details page (this is from the old server with only one log entry "productId: 676; portalId: 0; lang: en-US"), or is there an actual issue and the store tries to log and fails finding the log file.

@DNNMonster
Copy link
Collaborator

You configure the OS logging in the BO but it's creating xml files in the portals root dir. I am not sure about the storeLog.txt..

I'm still confused by the Portals_default dir which the error shows. It's non standard but I suppose not illicit.

Is the store running a custom ProductDisplayDetail.cshtml?

Anything happening in the razor that might be the culprit?

@BenderNETs
Copy link
Author

I'm so sorry for all the confusion. I found out that I tested something a few years back and created that log file temporarily (I completely forgot). For some reason that dll was in my backup that I moved over to the new server. After I copied the correct dll over, everything works. Again sorry :(

@jasclar
Copy link

jasclar commented Sep 25, 2023

I'm glad that you uncovered the cause and that it was not something more fundamental and worrying in the code. Thank you for letting us know.

@DNNMonster
Copy link
Collaborator

Alright! Sneaky dll's.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants