Skip to content

Importing Settings doesn't work #480

Description

@bennyevangelista

As in the title, from the Configure menu I exported a json settings file , when I try to import it I see the "settings imported" message, but no setting is loaded.

The json content seems correct, I see my highlighting settings and other options.

Activity

  1. Hirogen commented on Oct 6, 2025

    @Hirogen
    Member

    which version are you on?

  2. bennyevangelista commented on Oct 6, 2025

    @bennyevangelista
    Author

    I apologize, forgot to specify: v1.2.0 on windows10

  3. self-assigned this
    on Oct 7, 2025
  4. added
    bugPesky little gritter, needs squashing
    on Oct 7, 2025
  5. added theissue type on Oct 7, 2025
  6. bennyevangelista commented on Oct 8, 2025

    @bennyevangelista
    Author

    In addition, I'm experiencing strange beahviour with the application: when I close it and open it again, I often (not always) find all settings gone. It's like the application has been reset...somehow. Honestly, I don't think this is application related , but I can't think of any system related reason causing the issue. I never experienced something like this with version 1.9.0 (the last one I used before moving to 1.20.0). Do you have any suggestion?

  7. AndisGrossteins commented on Oct 8, 2025

    @AndisGrossteins
    Contributor

    @bennyevangelista This is a known issue in version 1.20.0 and fix is in the works. See issue #470.

    You might try downloading and running the snapshot build scroll to the very end and look for "Snapshot-Release".

    If you'd like to help with further troubleshooting, you can enable logging by dropping this NLog.config file in the LogExpert directory. Log will be written to C:\Temp\LogExpert\logs\logexpert.log (directory will be created) but you can edit the config file to change the path.
    After reproducing the error, please post the relevant (ERROR|FATAL) log messages here.

  8. Hirogen commented on Oct 10, 2025

    @Hirogen
    Member

    I apologize, forgot to specify: v1.2.0 on windows10

    what settings are not loaded? what is the value before and after loading? if a i import a settings.json, the settings are loaded and set to the settings in the json file, maybe a particular setting is missing?

    another problem could be, that the loaded settings are overwritten by the settings that are stored in the "%appData%\logexpert folder

  9. slaslaster commented on Oct 14, 2025

    @slaslaster

    In addition, I'm experiencing strange beahviour with the application: when I close it and open it again, I often (not always) find all settings gone. It's like the application has been reset...somehow. Honestly, I don't think this is application related , but I can't think of any system related reason causing the issue. I never experienced something like this with version 1.9.0 (the last one I used before moving to 1.20.0). Do you have any suggestion?

    Same problem. Almost every time I close the application, all settings are lost and I have to reimport them again. Also, a few times a day LogExpert crashes, and all settings are lost, so I need to reimport them again . 1.20.0.0/Windows 11
    And one of the exported settings json cannot be applied again - and also 'Settings imported' windows appears showing that import worked.

  10. linked a pull request that will close this issueupdate settings, should now no longer be lost #485on Nov 3, 2025
  11. Hirogen commented on Nov 4, 2025

    @Hirogen
    Member

    hopefully fixed with #485

  12. AndisGrossteins commented on Nov 5, 2025

    @AndisGrossteins
    Contributor

    I tried importing settings in the build from the last PR and import fails with Columnizer type 'Apache error log' not found.
    The 'Apache error log' is a RegexColumnizer. Hard to tell which element it is because there are multiple references to that columnizer in the settings file.

    Stack trace:

    Error deserializing settings.json: Newtonsoft.Json.JsonSerializationException: Columnizer type 'Apache error log' not found.
       at LogExpert.Core.Classes.JsonConverters.ColumnizerJsonConverter.ReadJson(JsonReader reader, Type objectType, Object existingValue, JsonSerializer serializer) in D:\a\LogExpert\LogExpert\src\LogExpert.Core\Classes\JsonConverters\ColumnizerJsonConverter.cs:line 69
       at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.DeserializeConvertable(JsonConverter converter, JsonReader reader, Type objectType, Object existingValue)
       at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id)
       at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
       at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
       at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id)
       at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
       at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
       at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
       at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
       at Newtonsoft.Json.JsonSerializer.Deserialize(JsonReader reader, Type objectType)
       at Newtonsoft.Json.JsonConvert.DeserializeObject(String value, Type type, JsonSerializerSettings settings)
       at Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value, JsonSerializerSettings settings)
       at LogExpert.Config.ConfigManager.LoadOrCreateNew(FileInfo fileInfo) in D:\a\LogExpert\LogExpert\src\LogExpert\Config\ConfigManager.cs:line 326
    

    Also, the "Import Failed" dialog has only one button – "OK" but text mentions "YES" and "NO". I think I saw a Copilot comment about that discrepancy in the PR.

    Image
  13. AndisGrossteins commented on Nov 5, 2025

    @AndisGrossteins
    Contributor

    The culprit in my case is on JSON path FilterParams.CurrentColumnizer.
    Unfortunately, it also affects loading of settings and the recovery feature – loading from settings,json.bak – fails at the same point.

    Verbatim NLog log file from last startup:

    2025-11-06 01:17:12.7093 Started C:\Development\LogExpert_Snapshot-Debug\LogExpert.exe PID 14508 ver 1.20.0.0 at 11/06/2025 01:17:12
    2025-11-06 01:17:12.6951|INFO|Program|
    ============================================================================
    LogExpert 1.20.0 started.
    ============================================================================
    2025-11-06 01:17:12.7256|INFO|LogExpert.Config.ConfigManager|### Load: Loading settings
    2025-11-06 01:17:12.7256|INFO|LogExpert.Config.ConfigManager|### Load: Load settings standard mode
    2025-11-06 01:17:12.7349|INFO|LogExpert.Config.ConfigManager|Loading settings from: C:\Users\andis\AppData\Roaming\LogExpert\settings.json
    2025-11-06 01:17:13.2364|ERROR|LogExpert.Config.ConfigManager|Error deserializing settings.json: Newtonsoft.Json.JsonSerializationException: Columnizer type 'Apache error log' not found.
       at LogExpert.Core.Classes.JsonConverters.ColumnizerJsonConverter.ReadJson(JsonReader reader, Type objectType, Object existingValue, JsonSerializer serializer) in D:\a\LogExpert\LogExpert\src\LogExpert.Core\Classes\JsonConverters\ColumnizerJsonConverter.cs:line 69
       at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.DeserializeConvertable(JsonConverter converter, JsonReader reader, Type objectType, Object existingValue)
       at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerProperty, JsonReader reader, Object target)
       at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id)
       at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
       at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
       at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerProperty, JsonReader reader, Object target)
       at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id)
       at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
       at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
       at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
       at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
       at Newtonsoft.Json.JsonSerializer.Deserialize(JsonReader reader, Type objectType)
       at Newtonsoft.Json.JsonConvert.DeserializeObject(String value, Type type, JsonSerializerSettings settings)
       at Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value, JsonSerializerSettings settings)
       at LogExpert.Config.ConfigManager.LoadOrCreateNew(FileInfo fileInfo) in D:\a\LogExpert\LogExpert\src\LogExpert\Config\ConfigManager.cs:line 326
    2025-11-06 01:17:13.2364|WARN|LogExpert.Config.ConfigManager|Attempting to load from backup file: C:\Users\andis\AppData\Roaming\LogExpert\settings.json.bak
    2025-11-06 01:17:13.3567|ERROR|LogExpert.Config.ConfigManager|Unexpected error: Columnizer type 'Apache error log' not found.
    2025-11-06 01:17:13.3567|INFO|LogExpert.Config.ConfigManager|No settings file found, creating new default settings
    2025-11-06 01:17:14.1256|INFO|LogExpert.Classes.LogExpertProxy|Adding window to list
    

    I have already mentioned that the reason for the failure is that columnizers are not loaded yet during settings deserialization. Right now it's a bit of chicken/egg issue.

  14. Hirogen commented on Nov 6, 2025

    @Hirogen
    Member

    I tried importing settings in the build from the last PR and import fails with Columnizer type 'Apache error log' not found. The 'Apache error log' is a RegexColumnizer. Hard to tell which element it is because there are multiple references to that columnizer in the settings file.

    Stack trace:

    Also, the "Import Failed" dialog has only one button – "OK" but text mentions "YES" and "NO". I think I saw a Copilot comment about that discrepancy in the PR.

    could you add your settings.json so i can test this probably in the evening

  15. reopened this on Nov 6, 2025
  16. AndisGrossteins commented on Nov 6, 2025

    @AndisGrossteins
    Contributor

    could you add your settings.json so i can test this probably in the evening

    This is my settings.json after opening a log file, choosing custom RegexColumenizer, and filtering:

    {
      "$id": "1",
      "Preferences": {
        "$id": "2",
        "HighlightGroupList": [],
        "PortableMode": false,
        "ShowErrorMessageAllowOnlyOneInstances": false,
        "MaxLineLength": 20000,
        "AllowOnlyOneInstance": false,
        "AskForClose": false,
        "DarkMode": false,
        "UseLegacyReader": false,
        "ToolEntries": [],
        "TimestampControlDragOrientation": 0,
        "TimestampControl": false,
        "TimeSpreadTimeMode": false,
        "SessionSaveDirectory": "",
        "SaveFilters": true,
        "SaveLocation": 0,
        "SaveSessions": true,
        "SetLastColumnWidth": false,
        "ShowBubbles": true,
        "ShowColumnFinder": false,
        "ShowTailColor": "Blue",
        "ShowTailState": true,
        "ShowTimeSpread": false,
        "TimeSpreadColor": "Gray",
        "IsAutoHideFilterList": false,
        "IsFilterOnLoad": false,
        "LastColumnWidth": 2000,
        "LinesPerBuffer": 500,
        "MaximumFilterEntries": 30,
        "MaximumFilterEntriesDisplayed": 20,
        "MaskPrio": true,
        "AutoPick": true,
        "MultiFileOption": 0,
        "MultiFileOptions": {
          "$id": "3",
          "MaxDayTry": 3,
          "FormatPattern": "*$J(.)"
        },
        "MultiThreadFilter": true,
        "OpenLastFiles": true,
        "PollingInterval": 250,
        "ReverseAlpha": false,
        "BufferCount": 100,
        "ColumnizerMaskList": [],
        "DefaultEncoding": "utf-8",
        "FilterSync": true,
        "FilterTail": true,
        "FollowTail": true,
        "FontName": "Courier New",
        "FontSize": 9.0,
        "HighlightMaskList": []
      },
      "RegexHistory": {
        "$id": "5",
        "ExpressionHistoryList": [],
        "TesttextHistoryList": []
      },
      "AlwaysOnTop": false,
      "AppBounds": "0, 0, 136, 39",
      "AppBoundsFullscreen": "-8, -8, 1696, 1018",
      "ColumnizerHistoryList": [
        {
          "$id": "6",
          "FileName": "C:\\var\\log\\apache2\\error.log",
          "ColumnizerName": "Apache error logs"
        }
      ],
      "FileColors": [],
      "FileHistoryList": [
        "C:\\var\\log\\apache2\\error.log"
      ],
      "FilterHistoryList": [
        "(err|warn)",
        "(error|warn)",
        "error"
      ],
      "FilterList": [],
      "FilterParams": {
        "$id": "7",
        "SearchText": "(err|warn)",
        "RangeSearchText": "",
        "IsCaseSensitive": true,
        "IsFilterTail": true,
        "FuzzyValue": 0,
        "EmptyColumnUsePrev": false,
        "EmptyColumnHit": false,
        "ExactColumnMatch": false,
        "ColumnRestrict": false,
        "Color": "Black",
        "SpreadBefore": 0,
        "SpreadBehind": 0,
        "IsInvert": false,
        "IsRangeSearch": false,
        "IsRegex": true,
        "ColumnList": [],
        "CurrentColumnizer": {
          "Type": "Apache error logs",
          "State": {}
        }
      },
      "FilterRangeHistoryList": [],
      "HideLineColumn": false,
      "IsMaximized": true,
      "LastDirectory": "C:\\var\\log\\apache2",
      "LastOpenFilesList": [],
      "SearchHistoryList": [],
      "SearchParams": {
        "$id": "8",
        "CurrentLine": 0,
        "HistoryList": [],
        "IsCaseSensitive": false,
        "IsFindNext": false,
        "IsForward": true,
        "IsFromTop": false,
        "IsRegex": false,
        "SearchText": "",
        "IsShiftF3Pressed": false
      },
      "UriHistoryList": [],
      "VersionBuild": 0
    }

    The RegexColumnizer XML from %AppData%\LogExpert\Regex7Columnizer.xml:

    <?xml version="1.0" encoding="utf-8"?>
    <RegexColumnizerConfig xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
      <Expression>\[(?&lt;Time&gt;\w{3} \w{3} \d{2} \d+:\d+:\d+.\d+ \d{4}|\d{4}-\d{2}-\d{2} \d+:\d+:\d+.\d+)\] \[(?&lt;Source&gt;\w+):(?&lt;level&gt;\w+)\] \[pid (?&lt;process&gt;\d+):?(?&lt;thread&gt;tid \d+)?\] (?&lt;message&gt;.*)</Expression>
      <Name>Apache error logs</Name>
    </RegexColumnizerConfig>

    Just to reiterate, steps to reproduce the issue:

    1. Load a log file
    2. Choose a columnizer that is a plugin (not built-in)
    3. Enable filtering and search for whatever
    4. Close LogExpert to save the settings with FilterParams.CurrentColumnizer set
    5. Open LogExpert again to trigger the issue
  17. Hirogen commented on Nov 7, 2025

    @Hirogen
    Member

    yeah, i see the problem, it's the regex7columnizer that is saved as xml and cannot be found, because it's not loaded. That's a tricky one, will take a little bit of time, till i can pinpoint the real root cause, and how to avoid it.

    Probably we need to load the regexColumnizers when loading the settings data and only then compare the columnizer name with what is saved in the settings

  18. AndisGrossteins commented on Nov 7, 2025

    @AndisGrossteins
    Contributor

    yeah, i see the problem, it's the regex7columnizer that is saved as xml and cannot be found, because it's not loaded. That's a tricky one, will take a little bit of time, till i can pinpoint the real root cause, and how to avoid it.

    The root cause is that the columnizer lookup/resolution is done when loading settings, before PluginRegistry loads and instanciates plugin assemblies.

    Probably we need to load the regexColumnizers when loading the settings data and only then compare the columnizer name with what is saved in the settings

    Yes, that would be a solution. Maybe the columnizer resolution logic could be moved to LogWindow (?) as an event listener and started by firing an event in PluginRegistry when it's done loading all plugins.

  19. Hirogen commented on Nov 8, 2025

    @Hirogen
    Member

    no that is not a good idea, logwindow is already a class full of stuff that it should not be responsible of

  20. AndisGrossteins commented on Nov 9, 2025

    @AndisGrossteins
    Contributor

    If adding more logic to LogWindow is not a great idea, then maybe the event callback could be introduced in the ConfigManager?

  21. Petro31 commented on Dec 6, 2025

    @Petro31

    Was this fixed? My settings with highlights still do not import in latest, 1.21.0.0

    logexpert.json

    there should be at least one option Dark Python Logs in the highlighting dropdown that are never loaded. Json file was created with 1.9.0

    Image Image

    Should I write up a new issue?

  22. AndisGrossteins commented on Dec 6, 2025

    @AndisGrossteins
    Contributor

    Json file was created with 1.9.0

    The format of settings file has changed and is not backwards compatible. You could try merging parts of your old settings.json into the new format.

    The oldest settings file I can find (not sure which version) has highlight settings in HilightEntryList but in recent versions it's been renamed to HighlightEntryList (correcting a typo).
    There are some other minor letter case differences (like IsRegex=>IsRegEx) that might prevent correct import, so pay attention to those. But the most important one is that all JSON objects in settings.json file should have a unique $id element.

    You can use a merge tool like WinMerge or Meld to compare and merge the files. To make it easier, create the same number of highlight entries with whatever options in the LogExpert 1.21.0 and then use that as a template to merge highlighter entries from the old settings.json file.

  23. Hirogen commented on Dec 6, 2025

    @Hirogen
    Member

    Was this fixed? My settings with highlights still do not import in latest, 1.21.0.0

    logexpert.json

    there should be at least one option Dark Python Logs in the highlighting dropdown that are never loaded. Json file was created with 1.9.0

    Image Image

    Should I write up a new issue?

    if you have an older version, i think till version 1.12 you it will be upgraded, but I'm not sure, its been a few years

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugPesky little gritter, needs squashing

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions