Getting an error in NotePad++ about a “session file” error when opening a .log file?

What Is NotePad++ ?

NotePad++ is an excellent text editor for Windows, much better than Windows Notepad, especially for editing multiple documents. If you are a website designer or computer programmer, I recommend it as one of the best available. NotePad++ knows the syntax of most computer programming languages, with Syntax Highlighting and Syntax Folding to help you see errors in your code. NotePadd++ has Perl Compatible Regular Expressions for searching and replacing. It has good macro recording and saving. (But, if you are wanting an integrated development environment, with debugging and viewing the results all in one, NotePad++ is not one.)

There is also a NotePad++ portable version, running off a thumb drive without any installation needed, so you have your favorite text editor with you on any computer you’re using.

NotePad++ Use of Log Files

But if you try viewing a .log file, for example from a website you are managing, it gives an error “Session file is either corrupted or not valid”. Huh?

Notepad++ lets you open a collection of files and remember them next time you start the program. The list of files, and other settings that make up your editing “session” are stored by default in .log files. So NotePad++ has default settings to open .log files as if they are NotePad++ session files.

Editing Log Files

Fortunately, almost all aspects of NotePadd++ can be configured how you want. Keystroke commands, menu items, tab settings, temporary file locations, and more.

To change the file extension NotePad++ uses for storing its own session information, go to the Settings, Preferences menu, and select “MISC”.

On that screen, change “Session file ext” and “Workspace file ext” both to “log” (without leading period).

Saving Your Editing Session

You’ll probably want to save the editing session from time to time. Do this with File, Save Session. I put the date in my session file name, e.g. “notepad-plus-plus session 2018-02-05”.

I also have Preferences set to automatically save the editing session and backup of all my (unsaved) edits. Do this with Settings, Preferences, Backup, put a checkmark in “Remember current session for next launch” and in “Enable session snapshot and periodic backup”.

NotePad++ settings to save editing session


Pin It on Pinterest

Share This