feat(logs): cleanup physical log files after 90 days by default (#6609)
2
apps/server/src/assets/doc_notes/en/User Guide/!!!meta.json
generated
vendored
@ -5,19 +5,62 @@
|
||||
<p>The <em>Quick search</em> function does a full-text search (that is, it
|
||||
searches through the content of notes and not just the title of a note)
|
||||
and displays the result in an easy-to-access manner.</p>
|
||||
<p>The alternative to the quick search is the <a class="reference-link"
|
||||
href="#root/_help_eIg8jdvaoNNd">Search</a> function, which opens in
|
||||
a dedicated tab and has support for advanced queries.</p>
|
||||
<p>For even faster navigation, it's possible to use <a class="reference-link"
|
||||
href="#root/_help_F1r9QtzQLZqm">Jump to Note</a> which will only search
|
||||
<p>The alternative to the quick search is the <a class="reference-link" href="#root/_help_eIg8jdvaoNNd">Search</a> function,
|
||||
which opens in a dedicated tab and has support for advanced queries.</p>
|
||||
<p>For even faster navigation, it's possible to use <a class="reference-link"
|
||||
href="#root/_help_F1r9QtzQLZqm">Jump to Note</a> which will only search
|
||||
through the note titles instead of the content.</p>
|
||||
<h2>Layout</h2>
|
||||
<p>Based on the <a class="reference-link" href="#root/_help_x0JgW8UqGXvq">Vertical and horizontal layout</a>,
|
||||
<p>Based on the <a class="reference-link" href="#root/_help_x0JgW8UqGXvq">Vertical and horizontal layout</a>,
|
||||
the quick search is placed:</p>
|
||||
<ul>
|
||||
<li>On the vertical layout, it is displayed right above the <a class="reference-link"
|
||||
<li>On the vertical layout, it is displayed right above the <a class="reference-link"
|
||||
href="#root/_help_oPVyFC7WL2Lp">Note Tree</a>.</li>
|
||||
<li>On the horizontal layout, it is displayed in the <a class="reference-link"
|
||||
<li>On the horizontal layout, it is displayed in the <a class="reference-link"
|
||||
href="#root/_help_xYmIYSP6wE3F">Launch Bar</a>, where it can be positioned
|
||||
just like any other icon.</li>
|
||||
</ul>
|
||||
<h2>Search Features</h2>
|
||||
<p>Quick search includes the following features:</p>
|
||||
<h3>Content Previews</h3>
|
||||
<p>Search results now display a 200-character preview of the note content
|
||||
below the note title. This preview shows the context where your search
|
||||
terms appear, making it easier to identify the right note without opening
|
||||
it.</p>
|
||||
<h3>Infinite Scrolling</h3>
|
||||
<p>Results are loaded progressively as you scroll:</p>
|
||||
<ul>
|
||||
<li>Initial display shows 15 results</li>
|
||||
<li>Scrolling near the bottom automatically loads 10 more results</li>
|
||||
<li>Continue scrolling to load all matching notes</li>
|
||||
</ul>
|
||||
<h3>Visual Features</h3>
|
||||
<ul>
|
||||
<li><strong>Highlighting</strong>: Search terms appear in bold with accent
|
||||
colors</li>
|
||||
<li><strong>Separation</strong>: Results are separated with dividers</li>
|
||||
<li><strong>Theme Support</strong>: Highlighting colors adapt to light/dark
|
||||
themes</li>
|
||||
</ul>
|
||||
<h3>Search Behavior</h3>
|
||||
<p>Quick search uses progressive search:</p>
|
||||
<ol>
|
||||
<li>Shows exact matches first</li>
|
||||
<li>Includes fuzzy matches when exact results are fewer than 5</li>
|
||||
<li>Exact matches appear before fuzzy matches</li>
|
||||
</ol>
|
||||
<h3>Keyboard Navigation</h3>
|
||||
<ul>
|
||||
<li>Press <code>Enter</code> to open the first result</li>
|
||||
<li>Use arrow keys to navigate through results</li>
|
||||
<li>Press <code>Escape</code> to close the quick search</li>
|
||||
</ul>
|
||||
<h2>Using Quick Search</h2>
|
||||
<ol>
|
||||
<li><strong>Typo tolerance</strong>: Search finds results despite minor typos</li>
|
||||
<li><strong>Content previews</strong>: 200-character snippets show match context</li>
|
||||
<li><strong>Infinite scrolling</strong>: Additional results load on scroll</li>
|
||||
<li><strong>Specific terms</strong>: Specific search terms return more focused
|
||||
results</li>
|
||||
<li><strong>Match locations</strong>: Bold text indicates where matches occur</li>
|
||||
</ol>
|
@ -138,9 +138,9 @@
|
||||
not equal to".</li>
|
||||
<li><code>#book #publicationYear >= 1950 #publicationYear < 1960</code>:
|
||||
Use numeric operators to find all books published in the 1950s.</li>
|
||||
<li><code>#dateNote >= TODAY-30</code>: A "smart search" to find notes
|
||||
with the "dateNote" label within the last 30 days. Supported smart values
|
||||
include NOW +- seconds, TODAY +- days, MONTH +- months, YEAR +- years.</li>
|
||||
<li><code>#dateNote >= TODAY-30</code>: Find notes with the "dateNote"
|
||||
label within the last 30 days. Supported date values include NOW +- seconds,
|
||||
TODAY +- days, MONTH +- months, YEAR +- years.</li>
|
||||
<li><code>~author.title *=* Tolkien</code>: Find notes related to an author
|
||||
whose title contains "Tolkien".</li>
|
||||
<li><code>#publicationYear %= '19[0-9]{2}'</code>: Use the '%=' operator to
|
||||
@ -149,6 +149,26 @@
|
||||
<li><code>note.content %= '\\d{2}:\\d{2} (PM|AM)'</code>: Find notes that
|
||||
mention a time. Backslashes in a regex must be escaped.</li>
|
||||
</ul>
|
||||
<h3>Fuzzy Search</h3>
|
||||
<p>Trilium supports fuzzy search operators that find results with typos or
|
||||
spelling variations:</p>
|
||||
<ul>
|
||||
<li><code>#title ~= trilim</code>: Fuzzy exact match - finds notes with titles
|
||||
like "Trilium" even if you typed "trilim" (with typo)</li>
|
||||
<li><code>#content ~* progra</code>: Fuzzy contains match - finds notes containing
|
||||
words like "program", "programmer", "programming" even with slight misspellings</li>
|
||||
<li><code>note.content ~* develpment</code>: Will find notes containing "development"
|
||||
despite the typo</li>
|
||||
</ul>
|
||||
<p><strong>Important notes about fuzzy search:</strong>
|
||||
</p>
|
||||
<ul>
|
||||
<li>Fuzzy search requires at least 3 characters in the search term</li>
|
||||
<li>Maximum edit distance is 2 characters (number of character changes needed)</li>
|
||||
<li>Diacritics are normalized (e.g., "café" matches "cafe")</li>
|
||||
<li>Fuzzy matches work best for finding content with minor typos or spelling
|
||||
variations</li>
|
||||
</ul>
|
||||
<h3>Advanced Use Cases</h3>
|
||||
<ul>
|
||||
<li><code>~author.relations.son.title = 'Christopher Tolkien'</code>: Search
|
||||
@ -206,6 +226,45 @@
|
||||
<h3>Negation</h3>
|
||||
<p>Some queries can only be expressed with negation:</p><pre><code class="language-text-x-trilium-auto">#book AND not(note.ancestor.title = 'Tolkien')</code></pre>
|
||||
<p>This query finds all book notes not in the "Tolkien" subtree.</p>
|
||||
<h2>Progressive Search Strategy</h2>
|
||||
<p>Trilium uses a progressive search strategy that performs exact matching
|
||||
first, then adds fuzzy matching when needed.</p>
|
||||
<h3>How Progressive Search Works</h3>
|
||||
<ol>
|
||||
<li>
|
||||
<p><strong>Phase 1 - Exact Matching</strong>: When you search, Trilium first
|
||||
looks for exact matches of your search terms. This handles the vast majority
|
||||
of searches (90%+) and returns results almost instantly.</p>
|
||||
</li>
|
||||
<li>
|
||||
<p><strong>Phase 2 - Fuzzy Fallback</strong>: If Phase 1 doesn't find enough
|
||||
high-quality results (fewer than 5 results with good relevance scores),
|
||||
Trilium automatically adds fuzzy matching to find results with typos or
|
||||
spelling variations.</p>
|
||||
</li>
|
||||
<li>
|
||||
<p><strong>Result Ordering</strong>: Exact matches always appear before fuzzy
|
||||
matches, regardless of individual scores. This ensures that when you search
|
||||
for "project", notes containing the exact word "project" will appear before
|
||||
notes containing similar words like "projects" or "projection".</p>
|
||||
</li>
|
||||
</ol>
|
||||
<h3>Progressive Search Behavior</h3>
|
||||
<ul>
|
||||
<li><strong>Speed</strong>: Most searches complete using only exact matching</li>
|
||||
<li><strong>Ordering</strong>: Exact matches appear before fuzzy matches</li>
|
||||
<li><strong>Fallback</strong>: Fuzzy matching activates when exact matches
|
||||
return fewer than 5 results</li>
|
||||
<li><strong>Identification</strong>: Results indicate whether they are exact
|
||||
or fuzzy matches</li>
|
||||
</ul>
|
||||
<h3>Search Performance</h3>
|
||||
<p>Search system specifications:</p>
|
||||
<ul>
|
||||
<li>Content size limit: 10MB per note (previously 50KB)</li>
|
||||
<li>Edit distance calculations for fuzzy matching</li>
|
||||
<li>Infinite scrolling in Quick Search</li>
|
||||
</ul>
|
||||
<h2>Under the Hood</h2>
|
||||
<h3>Label and Relation Shortcuts</h3>
|
||||
<p>The "full" syntax for searching by labels is:</p><pre><code class="language-text-x-trilium-auto">note.labels.publicationYear = 1954</code></pre>
|
||||
@ -213,8 +272,8 @@
|
||||
<p>However, common label and relation searches have shortcut syntax:</p><pre><code class="language-text-x-trilium-auto">#publicationYear = 1954
|
||||
#author.title *=* Tolkien</code></pre>
|
||||
<h3>Separating Full-Text and Attribute Parts</h3>
|
||||
<p>Search syntax allows combining full-text search with attribute-based search
|
||||
seamlessly. For example, <code>tolkien #book</code> contains:</p>
|
||||
<p>Search syntax allows combining full-text search with attribute-based search.
|
||||
For example, <code>tolkien #book</code> contains:</p>
|
||||
<ol>
|
||||
<li>Full-text tokens - <code>tolkien</code>
|
||||
</li>
|
||||
@ -243,3 +302,45 @@
|
||||
in the URL:</p>
|
||||
<p><code>http://localhost:8080/#?searchString=abc</code>
|
||||
</p>
|
||||
<h2>Search Configuration</h2>
|
||||
<h3>Parameters</h3>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Parameter</th>
|
||||
<th>Value</th>
|
||||
<th>Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>MIN_FUZZY_TOKEN_LENGTH</td>
|
||||
<td>3</td>
|
||||
<td>Minimum characters for fuzzy matching</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>MAX_EDIT_DISTANCE</td>
|
||||
<td>2</td>
|
||||
<td>Maximum character changes allowed</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>RESULT_SUFFICIENCY_THRESHOLD</td>
|
||||
<td>5</td>
|
||||
<td>Minimum exact results before fuzzy fallback</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>MAX_CONTENT_SIZE</td>
|
||||
<td>10MB</td>
|
||||
<td>Maximum note content size for search processing</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<h3>Limits</h3>
|
||||
<ul>
|
||||
<li>Searched note content is limited to 10MB per note to prevent performance
|
||||
issues</li>
|
||||
<li>Notes exceeding this limit will still be included in title and attribute
|
||||
searches</li>
|
||||
<li>Fuzzy matching requires tokens of at least 3 characters</li>
|
||||
</ul>
|
28
apps/server/src/assets/doc_notes/en/User Guide/User Guide/FAQ.html
generated
vendored
@ -71,3 +71,31 @@
|
||||
required for a note-taking application, having transactions make it way
|
||||
easier to keep notes and their metadata in predictable and consistent state.</li>
|
||||
</ul>
|
||||
<h2>Search-related Questions</h2>
|
||||
<h3>Why does search sometimes find results with typos?</h3>
|
||||
<p>Trilium uses a progressive search strategy that includes fuzzy matching
|
||||
when exact matches return fewer than 5 results. This finds notes despite
|
||||
minor typos in your search query. You can use fuzzy search operators (<code>~=</code> for
|
||||
fuzzy exact match and <code>~*</code> for fuzzy contains). See the <a class="reference-link"
|
||||
href="#root/_help_eIg8jdvaoNNd">Search</a> documentation for details.</p>
|
||||
<h3>How can I search for notes when I'm not sure of the exact spelling?</h3>
|
||||
<p>Use the fuzzy search operators:</p>
|
||||
<ul>
|
||||
<li><code>#title ~= "projct"</code> - finds notes with titles like "project"
|
||||
despite the typo</li>
|
||||
<li><code>note.content ~* "algoritm"</code> - finds content containing "algorithm"
|
||||
or similar words</li>
|
||||
</ul>
|
||||
<h3>Why do some search results appear before others with lower scores?</h3>
|
||||
<p>Trilium places exact matches before fuzzy matches. When you search for
|
||||
"project", notes containing exactly "project" appear before notes with
|
||||
variations like "projects" or "projection", regardless of other scoring
|
||||
factors.</p>
|
||||
<h3>How can I make my searches faster?</h3>
|
||||
<ol>
|
||||
<li>Use the "Fast search" option to search only titles and attributes (not
|
||||
content)</li>
|
||||
<li>Limit search scope using the "Ancestor" field</li>
|
||||
<li>Set a result limit to prevent loading too many results</li>
|
||||
<li>For large databases, consider archiving old notes to reduce search scope</li>
|
||||
</ol>
|
@ -27,43 +27,38 @@ class="admonition warning">
|
||||
</aside>
|
||||
<h3>TOTP</h3>
|
||||
<ol>
|
||||
<li data-list-item-id="ee190226d19e91a9330c263fa05fc61e7">Go to "Menu" -> "Options" -> "MFA"</li>
|
||||
<li data-list-item-id="ec7573505a7c9607c44a6a525a063fd3d">Click the “Enable Multi-Factor Authentication” checkbox if not checked</li>
|
||||
<li
|
||||
data-list-item-id="e49b476d39ceb086ac8ffab93be7ddb46">Choose “Time-Based One-Time Password (TOTP)” under MFA Method</li>
|
||||
<li
|
||||
data-list-item-id="e8104db62f8a7b835cba5c79377ea441d">Click the "Generate TOTP Secret" button</li>
|
||||
<li data-list-item-id="e4928e65314a99efe44ee2806c989ac45">Copy the generated secret to your authentication app/extension</li>
|
||||
<li
|
||||
data-list-item-id="ea96afadbac44638a6ec6e13733e23b53">Click the "Generate Recovery Codes" button</li>
|
||||
<li data-list-item-id="e67fffe2e3d945b23f93668c3ead03da7">Save the recovery codes. Recovery codes can be used once in place of the
|
||||
TOTP if you loose access to your authenticator. After a rerecovery code
|
||||
is used, it will show the unix timestamp when it was used in the MFA options
|
||||
tab.</li>
|
||||
<li data-list-item-id="ee94c4493042bb4d50ef6e07a30c65b95">Re-login will be required after TOTP setup is finished (After you refreshing
|
||||
the page).</li>
|
||||
<li>Go to "Menu" -> "Options" -> "MFA"</li>
|
||||
<li>Click the “Enable Multi-Factor Authentication” checkbox if not checked</li>
|
||||
<li>Choose “Time-Based One-Time Password (TOTP)” under MFA Method</li>
|
||||
<li>Click the "Generate TOTP Secret" button</li>
|
||||
<li>Copy the generated secret to your authentication app/extension</li>
|
||||
<li>Click the "Generate Recovery Codes" button</li>
|
||||
<li>Save the recovery codes. Recovery codes can be used once in place of the
|
||||
TOTP if you loose access to your authenticator. After a rerecovery code
|
||||
is used, it will show the unix timestamp when it was used in the MFA options
|
||||
tab.</li>
|
||||
<li>Re-login will be required after TOTP setup is finished (After you refreshing
|
||||
the page).</li>
|
||||
</ol>
|
||||
<h3>OpenID</h3>
|
||||
<p>In order to setup OpenID, you will need to setup a authentication provider.
|
||||
This requires a bit of extra setup. Follow <a href="https://developers.google.com/identity/openid-connect/openid-connect">these instructions</a> to
|
||||
setup an OpenID service through google. The Redirect URL of Trilium is <code>https://<your-trilium-domain>/callback</code>.</p>
|
||||
<ol>
|
||||
<li data-list-item-id="e12ea6450b407f0bbcb4109ef082bdfe3">Set the <code>oauthBaseUrl</code>, <code>oauthClientId</code> and <code>oauthClientSecret</code> in
|
||||
<li>Set the <code>oauthBaseUrl</code>, <code>oauthClientId</code> and <code>oauthClientSecret</code> in
|
||||
the <code>config.ini</code> file (check <a class="reference-link" href="#root/_help_Gzjqa934BdH4">Configuration (config.ini or environment variables)</a> for
|
||||
more information).
|
||||
<ol>
|
||||
<li data-list-item-id="ed369d1f114cb20a128dc286729d8370d">You can also setup through environment variables (<code>TRILIUM_OAUTH_BASE_URL</code>, <code>TRILIUM_OAUTH_CLIENT_ID</code> and <code>TRILIUM_OAUTH_CLIENT_SECRET</code>).</li>
|
||||
<li
|
||||
data-list-item-id="e1b13f1b5f3be3cf1d2cb4f26da326b60"><code>oauthBaseUrl</code> should be the link of your Trilium instance server,
|
||||
<li>You can also setup through environment variables (<code>TRILIUM_OAUTH_BASE_URL</code>, <code>TRILIUM_OAUTH_CLIENT_ID</code> and <code>TRILIUM_OAUTH_CLIENT_SECRET</code>).</li>
|
||||
<li><code>oauthBaseUrl</code> should be the link of your Trilium instance server,
|
||||
for example, <code>https://<your-trilium-domain></code>.</li>
|
||||
</ol>
|
||||
</ol>
|
||||
</li>
|
||||
<li data-list-item-id="e7e03745ea93c9ce8d79cfb4bd2815db2">Restart the server</li>
|
||||
<li data-list-item-id="edbb2231e1ec4b4d1296245db1ab87f8d">Go to "Menu" -> "Options" -> "MFA"</li>
|
||||
<li data-list-item-id="e1300f72967b25817d5944b27afa26182">Click the “Enable Multi-Factor Authentication” checkbox if not checked</li>
|
||||
<li
|
||||
data-list-item-id="ea1290a6b9568d1f4bf44c803d366248d">Choose “OAuth/OpenID” under MFA Method</li>
|
||||
<li data-list-item-id="e1801298cdda474547d810959fc3e79ef">Refresh the page and login through OpenID provider</li>
|
||||
<li>Restart the server</li>
|
||||
<li>Go to "Menu" -> "Options" -> "MFA"</li>
|
||||
<li>Click the “Enable Multi-Factor Authentication” checkbox if not checked</li>
|
||||
<li>Choose “OAuth/OpenID” under MFA Method</li>
|
||||
<li>Refresh the page and login through OpenID provider</li>
|
||||
</ol>
|
||||
<aside class="admonition note">
|
||||
<p>The default OAuth issuer is Google. To use other services such as Authentik
|
||||
@ -78,19 +73,18 @@ class="admonition warning">
|
||||
<a
|
||||
href="https://docs.goauthentik.io/docs/install-config/install/docker-compose">these instructions</a>to set one up.</p>
|
||||
<ol>
|
||||
<li data-list-item-id="eedb3ea2a0107b0bc34a61a088fba1b2d">In the Authentik admin dashboard, create a new OAuth2 application by following
|
||||
<li>In the Authentik admin dashboard, create a new OAuth2 application by following
|
||||
<a
|
||||
href="https://docs.goauthentik.io/docs/add-secure-apps/providers/oauth2/create-oauth2-provider">these steps</a>. Make sure to set the Redirect URL to: <code>https://<your-trilium-domain>/callback</code>.</li>
|
||||
<li
|
||||
data-list-item-id="eb98f26412740c574a384128637681e7d">In your config.ini file, set the relevant OAuth variables:
|
||||
<li>In your config.ini file, set the relevant OAuth variables:
|
||||
<ol>
|
||||
<li data-list-item-id="e12ec552e0c5ce7f6a12af520dc6d8aa2"><code>oauthIssuerBaseUrl</code> → Use the <code>OpenID Configuration Issuer</code> URL
|
||||
<li><code>oauthIssuerBaseUrl</code> → Use the <code>OpenID Configuration Issuer</code> URL
|
||||
from your application's overview page.</li>
|
||||
<li data-list-item-id="e3f6d6bbf6cf4cdee38be3a7d53bd57b9"><code>oauthIssuerName</code> and <code>oauthIssuerIcon</code> → Set these
|
||||
<li><code>oauthIssuerName</code> and <code>oauthIssuerIcon</code> → Set these
|
||||
to customize the name and icon displayed on the login page. If omitted,
|
||||
Google’s name and icon will be shown by default.</li>
|
||||
</ol>
|
||||
</li>
|
||||
<li data-list-item-id="eeae084919db88733646612f3c4f55a6e">Apply the changes by restarting your server.</li>
|
||||
<li data-list-item-id="ec71ab917862af5f96f2a5567d82ac0da">Proceed with the remaining steps starting from Step 3 in the OpenID section.</li>
|
||||
</li>
|
||||
<li>Apply the changes by restarting your server.</li>
|
||||
<li>Proceed with the remaining steps starting from Step 3 in the OpenID section.</li>
|
||||
</ol>
|
@ -1,33 +1,12 @@
|
||||
<p>It's important to provide all available error logs together with bug reports.
|
||||
This page will show you how to do it.</p>
|
||||
<h2>Backend logs</h2>
|
||||
<p>Open <a href="#root/_help_tAassRL4RSQL">data directory</a>, go to <code>log</code> subdirectory
|
||||
and find the latest log file, e.g. <code>trilium-2022-12-14.log</code>.
|
||||
You can attach the whole file to the bug report (preferable) or open it
|
||||
and copy-paste only the last lines / lines you believe are relevant.</p>
|
||||
<p>If you have trouble finding it the log files, there's also an in-app option
|
||||
in top-left menu button -> Advanced -> Show backend log.</p>
|
||||
<h2>Frontend logs</h2>
|
||||
<p>To provide frontend logs, we need to open the Developer Console. Often
|
||||
the easiest way is to press <kbd>Ctrl</kbd>-<kbd>Shift</kbd>-<kbd>I</kbd> which
|
||||
should work in most browsers (and desktop app). Make sure that the error
|
||||
producing action happened right before you copy&paste the errors, the
|
||||
console is cleared on app restart.</p>
|
||||
<p>If that doesn't work, then:</p>
|
||||
<p>It's important to provide all available error logs together with bug reports.</p>
|
||||
<p>There are two types of error logs, both of which are useful when reporting
|
||||
bugs.</p>
|
||||
<ul>
|
||||
<li>in Trilium desktop app, go to top-left menu button -> Advanced ->
|
||||
Open Dev Tools</li>
|
||||
<li>In Firefox/Chrome right-click anywhere in the page and click Inspect:</li>
|
||||
<li data-list-item-id="e5d891396e04bcb9d78ea10421e8ee6be"><a class="reference-link" href="#root/pOsGYCXsbNQG/BgmBlOIl72jZ/qzNzp9LYQyPT/_help_bnyigUA2UK7s">Backend (server) logs</a>
|
||||
</li>
|
||||
<li data-list-item-id="e94ecb76c9af944e47bf8b5c5dabf027a"><a class="reference-link" href="#root/pOsGYCXsbNQG/BgmBlOIl72jZ/qzNzp9LYQyPT/_help_9yEHzMyFirZR">Frontend logs</a>
|
||||
</li>
|
||||
</ul>
|
||||
<p>
|
||||
<img src="Error logs_error-logs-fire.png">
|
||||
</p>
|
||||
<p>Once you have Dev Tools open, click on "Console" tab:</p>
|
||||
<p>
|
||||
<img src="Error logs_image.png">
|
||||
</p>
|
||||
<p>Copy-paste (or screenshot) the logs. It's better to provide not just errors,
|
||||
but the whole log, which might provide context while analyzing the bug.</p>
|
||||
<h2>Providing sensitive data</h2>
|
||||
<p>If you don't feel comfortable attaching the logs or anything sensitive
|
||||
to the public GitHub issues, feel free to contact the devs in our Matrix
|
||||
|
26
apps/server/src/assets/doc_notes/en/User Guide/User Guide/Troubleshooting/Error logs/Backend (server) logs.html
generated
vendored
Normal file
@ -0,0 +1,26 @@
|
||||
<h2>Accessing via the backend log</h2>
|
||||
<p>In the <a class="reference-link" href="#root/pOsGYCXsbNQG/gh7bpGYxajRS/Vc8PjrjAGuOp/_help_x3i7MxGccDuM">Global menu</a>,
|
||||
go to Advanced → Show backend log</p>
|
||||
<h2>Location on the disk</h2>
|
||||
<p>Backend logs are stored on the file system. To find them, open the
|
||||
<a
|
||||
class="reference-link" href="#root/pOsGYCXsbNQG/Otzi9La2YAUX/_help_tAassRL4RSQL">Data directory</a>, go to the <code>log</code> subdirectory and find the
|
||||
latest log file, e.g. <code>trilium-2022-12-14.log</code>. </p>
|
||||
<h2>Reporting backend bugs</h2>
|
||||
<p>You can attach the whole file to the bug report (preferable) or open it
|
||||
and copy-paste only the last lines / lines you believe are relevant.</p>
|
||||
<h2>Customizing the retention of logs</h2>
|
||||
<p>The backend logs are fully managed by the Trilium server. By default the
|
||||
last 90 days worth of logs are kept; the logs older than that are deleted
|
||||
in order to reduce the space consumption.</p>
|
||||
<p>It's possible to change the retention period by modifying the
|
||||
<a
|
||||
class="reference-link" href="#root/pOsGYCXsbNQG/tC7s2alapj8V/_help_Gzjqa934BdH4">Configuration (config.ini or environment variables)</a> via the <code>.ini</code> file:</p><pre><code class="language-text-x-trilium-auto">[Logging]
|
||||
retentionDays=7</code></pre>
|
||||
<p>Or via the environment variable <code>TRILIUM_LOGGING_RETENTION_DAYS</code>.</p>
|
||||
<aside
|
||||
class="admonition note">
|
||||
<p>If you set the retention days to a low number, you might notice that not
|
||||
all the log files are being deleted. This is because a minimum number of
|
||||
logs (7 at the time of writing) is maintained at all times.</p>
|
||||
</aside>
|
20
apps/server/src/assets/doc_notes/en/User Guide/User Guide/Troubleshooting/Error logs/Frontend logs.html
generated
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
<p>To provide frontend logs, we need to open the Developer Console. Often
|
||||
the easiest way is to press <kbd>Ctrl</kbd>-<kbd>Shift</kbd>-<kbd>I</kbd> which
|
||||
should work in most browsers (and desktop app). Make sure that the error
|
||||
producing action happened right before you copy&paste the errors, the
|
||||
console is cleared on app restart.</p>
|
||||
<p>If that doesn't work, then:</p>
|
||||
<ul>
|
||||
<li data-list-item-id="e1f836ac8425c0d56072614c40c996bbd">in Trilium desktop app, go to top-left menu button -> Advanced ->
|
||||
Open Dev Tools</li>
|
||||
<li data-list-item-id="e8bd27605bedefe884b826a1899413a6d">In Firefox/Chrome right-click anywhere in the page and click Inspect:</li>
|
||||
</ul>
|
||||
<p>
|
||||
<img src="Frontend logs_error-logs-f.png">
|
||||
</p>
|
||||
<p>Once you have Dev Tools open, click on "Console" tab:</p>
|
||||
<p>
|
||||
<img src="Frontend logs_image.png">
|
||||
</p>
|
||||
<p>Copy-paste (or screenshot) the logs. It's better to provide not just errors,
|
||||
but the whole log, which might provide context while analyzing the bug.</p>
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 136 KiB After Width: | Height: | Size: 136 KiB |
@ -3,7 +3,7 @@ import fs from "fs";
|
||||
import dataDir from "./data_dir.js";
|
||||
import path from "path";
|
||||
import resourceDir from "./resource_dir.js";
|
||||
import { envToBoolean } from "./utils.js";
|
||||
import { envToBoolean, stringToInt } from "./utils.js";
|
||||
|
||||
const configSampleFilePath = path.resolve(resourceDir.RESOURCE_DIR, "config-sample.ini");
|
||||
|
||||
@ -50,8 +50,16 @@ export interface TriliumConfig {
|
||||
oauthIssuerName: string;
|
||||
oauthIssuerIcon: string;
|
||||
};
|
||||
Logging: {
|
||||
/**
|
||||
* The number of days to keep the log files around. When rotating the logs, log files created by Trilium older than the specified amount of time will be deleted.
|
||||
*/
|
||||
retentionDays: number;
|
||||
}
|
||||
}
|
||||
|
||||
export const LOGGING_DEFAULT_RETENTION_DAYS = 90;
|
||||
|
||||
//prettier-ignore
|
||||
const config: TriliumConfig = {
|
||||
|
||||
@ -136,6 +144,13 @@ const config: TriliumConfig = {
|
||||
|
||||
oauthIssuerIcon:
|
||||
process.env.TRILIUM_OAUTH_ISSUER_ICON || iniConfig?.MultiFactorAuthentication?.oauthIssuerIcon || ""
|
||||
},
|
||||
|
||||
Logging: {
|
||||
retentionDays:
|
||||
stringToInt(process.env.TRILIUM_LOGGING_RETENTION_DAYS) ??
|
||||
stringToInt(iniConfig?.Logging?.retentionDays) ??
|
||||
LOGGING_DEFAULT_RETENTION_DAYS
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -2,9 +2,11 @@
|
||||
|
||||
import type { Request, Response } from "express";
|
||||
import fs from "fs";
|
||||
import path from "path";
|
||||
import { EOL } from "os";
|
||||
import dataDir from "./data_dir.js";
|
||||
import cls from "./cls.js";
|
||||
import config, { LOGGING_DEFAULT_RETENTION_DAYS } from "./config.js";
|
||||
|
||||
if (!fs.existsSync(dataDir.LOG_DIR)) {
|
||||
fs.mkdirSync(dataDir.LOG_DIR, 0o700);
|
||||
@ -17,6 +19,8 @@ const MINUTE = 60 * SECOND;
|
||||
const HOUR = 60 * MINUTE;
|
||||
const DAY = 24 * HOUR;
|
||||
|
||||
const MINIMUM_FILES_TO_KEEP = 7;
|
||||
|
||||
let todaysMidnight!: Date;
|
||||
|
||||
initLogFile();
|
||||
@ -27,16 +31,90 @@ function getTodaysMidnight() {
|
||||
return new Date(now.getFullYear(), now.getMonth(), now.getDate());
|
||||
}
|
||||
|
||||
async function cleanupOldLogFiles() {
|
||||
try {
|
||||
// Get retention days from environment or options
|
||||
let retentionDays = LOGGING_DEFAULT_RETENTION_DAYS;
|
||||
const customRetentionDays = config.Logging.retentionDays;
|
||||
if (customRetentionDays > 0) {
|
||||
retentionDays = customRetentionDays;
|
||||
}
|
||||
|
||||
const cutoffDate = new Date();
|
||||
cutoffDate.setDate(cutoffDate.getDate() - retentionDays);
|
||||
|
||||
// Read all log files
|
||||
const files = await fs.promises.readdir(dataDir.LOG_DIR);
|
||||
const logFiles: Array<{name: string, mtime: Date, path: string}> = [];
|
||||
|
||||
for (const file of files) {
|
||||
// Security: Only process files matching our log pattern
|
||||
if (!/^trilium-\d{4}-\d{2}-\d{2}\.log$/.test(file)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
const filePath = path.join(dataDir.LOG_DIR, file);
|
||||
|
||||
// Security: Verify path stays within LOG_DIR
|
||||
const resolvedPath = path.resolve(filePath);
|
||||
const resolvedLogDir = path.resolve(dataDir.LOG_DIR);
|
||||
if (!resolvedPath.startsWith(resolvedLogDir + path.sep)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
try {
|
||||
const stats = await fs.promises.stat(filePath);
|
||||
logFiles.push({ name: file, mtime: stats.mtime, path: filePath });
|
||||
} catch (err) {
|
||||
// Skip files we can't stat
|
||||
}
|
||||
}
|
||||
|
||||
// Sort by modification time (oldest first)
|
||||
logFiles.sort((a, b) => a.mtime.getTime() - b.mtime.getTime());
|
||||
|
||||
// Keep minimum number of files
|
||||
if (logFiles.length <= MINIMUM_FILES_TO_KEEP) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Delete old files, keeping minimum
|
||||
let deletedCount = 0;
|
||||
for (let i = 0; i < logFiles.length - MINIMUM_FILES_TO_KEEP; i++) {
|
||||
const file = logFiles[i];
|
||||
if (file.mtime < cutoffDate) {
|
||||
try {
|
||||
await fs.promises.unlink(file.path);
|
||||
deletedCount++;
|
||||
} catch (err) {
|
||||
// Log deletion failed, but continue with others
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (deletedCount > 0) {
|
||||
info(`Log cleanup: deleted ${deletedCount} old log files`);
|
||||
}
|
||||
} catch (err) {
|
||||
// Cleanup failed, but don't crash the log rotation
|
||||
}
|
||||
}
|
||||
|
||||
function initLogFile() {
|
||||
todaysMidnight = getTodaysMidnight();
|
||||
|
||||
const path = `${dataDir.LOG_DIR}/trilium-${formatDate()}.log`;
|
||||
const logPath = `${dataDir.LOG_DIR}/trilium-${formatDate()}.log`;
|
||||
|
||||
if (logFile) {
|
||||
logFile.end();
|
||||
|
||||
// Clean up old log files when rotating to a new file
|
||||
cleanupOldLogFiles().catch(() => {
|
||||
// Ignore cleanup errors
|
||||
});
|
||||
}
|
||||
|
||||
logFile = fs.createWriteStream(path, { flags: "a" });
|
||||
logFile = fs.createWriteStream(logPath, { flags: "a" });
|
||||
}
|
||||
|
||||
function checkDate(millisSinceMidnight: number) {
|
||||
|
@ -126,6 +126,7 @@ const defaultOptions: DefaultOption[] = [
|
||||
{ name: "disableTray", value: "false", isSynced: false },
|
||||
{ name: "eraseUnusedAttachmentsAfterSeconds", value: "2592000", isSynced: true }, // default 30 days
|
||||
{ name: "eraseUnusedAttachmentsAfterTimeScale", value: "86400", isSynced: true }, // default 86400 seconds = Day
|
||||
{ name: "logRetentionDays", value: "90", isSynced: false }, // default 90 days
|
||||
{ name: "customSearchEngineName", value: "DuckDuckGo", isSynced: true },
|
||||
{ name: "customSearchEngineUrl", value: "https://duckduckgo.com/?q={keyword}", isSynced: true },
|
||||
{ name: "promotedAttributesOpenInRibbon", value: "true", isSynced: true },
|
||||
|
@ -281,6 +281,25 @@ export function envToBoolean(val: string | undefined) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* Parses a string value to an integer. If the resulting number is NaN or undefined, the result is also undefined.
|
||||
*
|
||||
* @param val the value to parse.
|
||||
* @returns the parsed value.
|
||||
*/
|
||||
export function stringToInt(val: string | undefined) {
|
||||
if (!val) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
const parsed = parseInt(val, 10);
|
||||
if (Number.isNaN(parsed)) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
return parsed;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the directory for resources. On Electron builds this corresponds to the `resources` subdirectory inside the distributable package.
|
||||
* On development builds, this simply refers to the src directory of the application.
|
||||
|
156
docs/User Guide/!!!meta.json
vendored
@ -4841,31 +4841,38 @@
|
||||
{
|
||||
"type": "relation",
|
||||
"name": "internalLink",
|
||||
"value": "wy8So3yZZlH9",
|
||||
"value": "eIg8jdvaoNNd",
|
||||
"isInheritable": false,
|
||||
"position": 50
|
||||
},
|
||||
{
|
||||
"type": "relation",
|
||||
"name": "internalLink",
|
||||
"value": "CdNpE2pqjmI6",
|
||||
"value": "wy8So3yZZlH9",
|
||||
"isInheritable": false,
|
||||
"position": 60
|
||||
},
|
||||
{
|
||||
"type": "relation",
|
||||
"name": "internalLink",
|
||||
"value": "tAassRL4RSQL",
|
||||
"value": "CdNpE2pqjmI6",
|
||||
"isInheritable": false,
|
||||
"position": 70
|
||||
},
|
||||
{
|
||||
"type": "relation",
|
||||
"name": "internalLink",
|
||||
"value": "cbkrhQjrkKrh",
|
||||
"value": "tAassRL4RSQL",
|
||||
"isInheritable": false,
|
||||
"position": 80
|
||||
},
|
||||
{
|
||||
"type": "relation",
|
||||
"name": "internalLink",
|
||||
"value": "cbkrhQjrkKrh",
|
||||
"isInheritable": false,
|
||||
"position": 90
|
||||
},
|
||||
{
|
||||
"type": "label",
|
||||
"name": "shareAlias",
|
||||
@ -9131,13 +9138,6 @@
|
||||
"type": "text",
|
||||
"mime": "text/markdown",
|
||||
"attributes": [
|
||||
{
|
||||
"type": "relation",
|
||||
"name": "internalLink",
|
||||
"value": "tAassRL4RSQL",
|
||||
"isInheritable": false,
|
||||
"position": 10
|
||||
},
|
||||
{
|
||||
"type": "relation",
|
||||
"name": "internalLink",
|
||||
@ -9151,27 +9151,32 @@
|
||||
"value": "error-logs",
|
||||
"isInheritable": false,
|
||||
"position": 30
|
||||
},
|
||||
{
|
||||
"type": "relation",
|
||||
"name": "internalLink",
|
||||
"value": "bnyigUA2UK7s",
|
||||
"isInheritable": false,
|
||||
"position": 40
|
||||
},
|
||||
{
|
||||
"type": "relation",
|
||||
"name": "internalLink",
|
||||
"value": "9yEHzMyFirZR",
|
||||
"isInheritable": false,
|
||||
"position": 50
|
||||
},
|
||||
{
|
||||
"type": "label",
|
||||
"name": "iconClass",
|
||||
"value": "bx bx-comment-error",
|
||||
"isInheritable": false,
|
||||
"position": 60
|
||||
}
|
||||
],
|
||||
"format": "markdown",
|
||||
"dataFileName": "Error logs.md",
|
||||
"attachments": [
|
||||
{
|
||||
"attachmentId": "8b6d0LUU1aMl",
|
||||
"title": "image.png",
|
||||
"role": "image",
|
||||
"mime": "image/jpg",
|
||||
"position": 10,
|
||||
"dataFileName": "Error logs_image.png"
|
||||
},
|
||||
{
|
||||
"attachmentId": "krunYsa4JeyV",
|
||||
"title": "error-logs-firefox-context-men.png",
|
||||
"role": "image",
|
||||
"mime": "image/png",
|
||||
"position": 10,
|
||||
"dataFileName": "Error logs_error-logs-fire.png"
|
||||
},
|
||||
{
|
||||
"attachmentId": "ReQzLPod6UtU",
|
||||
"title": "error-logs-export-subtree.png",
|
||||
@ -9180,6 +9185,103 @@
|
||||
"position": 10,
|
||||
"dataFileName": "Error logs_error-logs-expo.png"
|
||||
}
|
||||
],
|
||||
"dirFileName": "Error logs",
|
||||
"children": [
|
||||
{
|
||||
"isClone": false,
|
||||
"noteId": "bnyigUA2UK7s",
|
||||
"notePath": [
|
||||
"pOsGYCXsbNQG",
|
||||
"BgmBlOIl72jZ",
|
||||
"qzNzp9LYQyPT",
|
||||
"bnyigUA2UK7s"
|
||||
],
|
||||
"title": "Backend (server) logs",
|
||||
"notePosition": 10,
|
||||
"prefix": null,
|
||||
"isExpanded": false,
|
||||
"type": "text",
|
||||
"mime": "text/html",
|
||||
"attributes": [
|
||||
{
|
||||
"type": "relation",
|
||||
"name": "internalLink",
|
||||
"value": "tAassRL4RSQL",
|
||||
"isInheritable": false,
|
||||
"position": 10
|
||||
},
|
||||
{
|
||||
"type": "relation",
|
||||
"name": "internalLink",
|
||||
"value": "x3i7MxGccDuM",
|
||||
"isInheritable": false,
|
||||
"position": 20
|
||||
},
|
||||
{
|
||||
"type": "relation",
|
||||
"name": "internalLink",
|
||||
"value": "Gzjqa934BdH4",
|
||||
"isInheritable": false,
|
||||
"position": 30
|
||||
},
|
||||
{
|
||||
"type": "label",
|
||||
"name": "iconClass",
|
||||
"value": "bx bx-server",
|
||||
"isInheritable": false,
|
||||
"position": 40
|
||||
}
|
||||
],
|
||||
"format": "markdown",
|
||||
"dataFileName": "Backend (server) logs.md",
|
||||
"attachments": []
|
||||
},
|
||||
{
|
||||
"isClone": false,
|
||||
"noteId": "9yEHzMyFirZR",
|
||||
"notePath": [
|
||||
"pOsGYCXsbNQG",
|
||||
"BgmBlOIl72jZ",
|
||||
"qzNzp9LYQyPT",
|
||||
"9yEHzMyFirZR"
|
||||
],
|
||||
"title": "Frontend logs",
|
||||
"notePosition": 20,
|
||||
"prefix": null,
|
||||
"isExpanded": false,
|
||||
"type": "text",
|
||||
"mime": "text/html",
|
||||
"attributes": [
|
||||
{
|
||||
"type": "label",
|
||||
"name": "iconClass",
|
||||
"value": "bx bx-window-alt",
|
||||
"isInheritable": false,
|
||||
"position": 10
|
||||
}
|
||||
],
|
||||
"format": "markdown",
|
||||
"dataFileName": "Frontend logs.md",
|
||||
"attachments": [
|
||||
{
|
||||
"attachmentId": "vRup2YTDpWPM",
|
||||
"title": "image.png",
|
||||
"role": "image",
|
||||
"mime": "image/jpg",
|
||||
"position": 10,
|
||||
"dataFileName": "Frontend logs_image.png"
|
||||
},
|
||||
{
|
||||
"attachmentId": "Y05WqmS4uMMt",
|
||||
"title": "error-logs-firefox-context-men.png",
|
||||
"role": "image",
|
||||
"mime": "image/png",
|
||||
"position": 10,
|
||||
"dataFileName": "Frontend logs_error-logs-f.png"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
|
@ -19,34 +19,41 @@ Based on the <a class="reference-link" href="../UI%20Elements/Vertical%20and%20h
|
||||
Quick search includes the following features:
|
||||
|
||||
### Content Previews
|
||||
|
||||
Search results now display a 200-character preview of the note content below the note title. This preview shows the context where your search terms appear, making it easier to identify the right note without opening it.
|
||||
|
||||
### Infinite Scrolling
|
||||
|
||||
Results are loaded progressively as you scroll:
|
||||
- Initial display shows 15 results
|
||||
- Scrolling near the bottom automatically loads 10 more results
|
||||
- Continue scrolling to load all matching notes
|
||||
|
||||
* Initial display shows 15 results
|
||||
* Scrolling near the bottom automatically loads 10 more results
|
||||
* Continue scrolling to load all matching notes
|
||||
|
||||
### Visual Features
|
||||
- **Highlighting**: Search terms appear in bold with accent colors
|
||||
- **Separation**: Results are separated with dividers
|
||||
- **Theme Support**: Highlighting colors adapt to light/dark themes
|
||||
|
||||
* **Highlighting**: Search terms appear in bold with accent colors
|
||||
* **Separation**: Results are separated with dividers
|
||||
* **Theme Support**: Highlighting colors adapt to light/dark themes
|
||||
|
||||
### Search Behavior
|
||||
|
||||
Quick search uses progressive search:
|
||||
1. Shows exact matches first
|
||||
2. Includes fuzzy matches when exact results are fewer than 5
|
||||
3. Exact matches appear before fuzzy matches
|
||||
|
||||
1. Shows exact matches first
|
||||
2. Includes fuzzy matches when exact results are fewer than 5
|
||||
3. Exact matches appear before fuzzy matches
|
||||
|
||||
### Keyboard Navigation
|
||||
- Press `Enter` to open the first result
|
||||
- Use arrow keys to navigate through results
|
||||
- Press `Escape` to close the quick search
|
||||
|
||||
* Press `Enter` to open the first result
|
||||
* Use arrow keys to navigate through results
|
||||
* Press `Escape` to close the quick search
|
||||
|
||||
## Using Quick Search
|
||||
|
||||
1. **Typo tolerance**: Search finds results despite minor typos
|
||||
2. **Content previews**: 200-character snippets show match context
|
||||
3. **Infinite scrolling**: Additional results load on scroll
|
||||
4. **Specific terms**: Specific search terms return more focused results
|
||||
5. **Match locations**: Bold text indicates where matches occur
|
||||
1. **Typo tolerance**: Search finds results despite minor typos
|
||||
2. **Content previews**: 200-character snippets show match context
|
||||
3. **Infinite scrolling**: Additional results load on scroll
|
||||
4. **Specific terms**: Specific search terms return more focused results
|
||||
5. **Match locations**: Bold text indicates where matches occur
|
@ -80,10 +80,11 @@ Trilium supports fuzzy search operators that find results with typos or spelling
|
||||
* `note.content ~* develpment`: Will find notes containing "development" despite the typo
|
||||
|
||||
**Important notes about fuzzy search:**
|
||||
- Fuzzy search requires at least 3 characters in the search term
|
||||
- Maximum edit distance is 2 characters (number of character changes needed)
|
||||
- Diacritics are normalized (e.g., "café" matches "cafe")
|
||||
- Fuzzy matches work best for finding content with minor typos or spelling variations
|
||||
|
||||
* Fuzzy search requires at least 3 characters in the search term
|
||||
* Maximum edit distance is 2 characters (number of character changes needed)
|
||||
* Diacritics are normalized (e.g., "café" matches "cafe")
|
||||
* Fuzzy matches work best for finding content with minor typos or spelling variations
|
||||
|
||||
### Advanced Use Cases
|
||||
|
||||
@ -137,25 +138,24 @@ Trilium uses a progressive search strategy that performs exact matching first, t
|
||||
|
||||
### How Progressive Search Works
|
||||
|
||||
1. **Phase 1 - Exact Matching**: When you search, Trilium first looks for exact matches of your search terms. This handles the vast majority of searches (90%+) and returns results almost instantly.
|
||||
|
||||
2. **Phase 2 - Fuzzy Fallback**: If Phase 1 doesn't find enough high-quality results (fewer than 5 results with good relevance scores), Trilium automatically adds fuzzy matching to find results with typos or spelling variations.
|
||||
|
||||
3. **Result Ordering**: Exact matches always appear before fuzzy matches, regardless of individual scores. This ensures that when you search for "project", notes containing the exact word "project" will appear before notes containing similar words like "projects" or "projection".
|
||||
1. **Phase 1 - Exact Matching**: When you search, Trilium first looks for exact matches of your search terms. This handles the vast majority of searches (90%+) and returns results almost instantly.
|
||||
2. **Phase 2 - Fuzzy Fallback**: If Phase 1 doesn't find enough high-quality results (fewer than 5 results with good relevance scores), Trilium automatically adds fuzzy matching to find results with typos or spelling variations.
|
||||
3. **Result Ordering**: Exact matches always appear before fuzzy matches, regardless of individual scores. This ensures that when you search for "project", notes containing the exact word "project" will appear before notes containing similar words like "projects" or "projection".
|
||||
|
||||
### Progressive Search Behavior
|
||||
|
||||
- **Speed**: Most searches complete using only exact matching
|
||||
- **Ordering**: Exact matches appear before fuzzy matches
|
||||
- **Fallback**: Fuzzy matching activates when exact matches return fewer than 5 results
|
||||
- **Identification**: Results indicate whether they are exact or fuzzy matches
|
||||
* **Speed**: Most searches complete using only exact matching
|
||||
* **Ordering**: Exact matches appear before fuzzy matches
|
||||
* **Fallback**: Fuzzy matching activates when exact matches return fewer than 5 results
|
||||
* **Identification**: Results indicate whether they are exact or fuzzy matches
|
||||
|
||||
### Search Performance
|
||||
|
||||
Search system specifications:
|
||||
- Content size limit: 10MB per note (previously 50KB)
|
||||
- Edit distance calculations for fuzzy matching
|
||||
- Infinite scrolling in Quick Search
|
||||
|
||||
* Content size limit: 10MB per note (previously 50KB)
|
||||
* Edit distance calculations for fuzzy matching
|
||||
* Infinite scrolling in Quick Search
|
||||
|
||||
## Under the Hood
|
||||
|
||||
@ -228,14 +228,14 @@ You can open Trilium and automatically trigger a search by including the search
|
||||
### Parameters
|
||||
|
||||
| Parameter | Value | Description |
|
||||
|-----------|-------|-------------|
|
||||
| MIN_FUZZY_TOKEN_LENGTH | 3 | Minimum characters for fuzzy matching |
|
||||
| MAX_EDIT_DISTANCE | 2 | Maximum character changes allowed |
|
||||
| RESULT_SUFFICIENCY_THRESHOLD | 5 | Minimum exact results before fuzzy fallback |
|
||||
| MAX_CONTENT_SIZE | 10MB | Maximum note content size for search processing |
|
||||
| --- | --- | --- |
|
||||
| MIN\_FUZZY\_TOKEN\_LENGTH | 3 | Minimum characters for fuzzy matching |
|
||||
| MAX\_EDIT\_DISTANCE | 2 | Maximum character changes allowed |
|
||||
| RESULT\_SUFFICIENCY\_THRESHOLD | 5 | Minimum exact results before fuzzy fallback |
|
||||
| MAX\_CONTENT\_SIZE | 10MB | Maximum note content size for search processing |
|
||||
|
||||
### Limits
|
||||
|
||||
* Searched note content is limited to 10MB per note to prevent performance issues
|
||||
* Notes exceeding this limit will still be included in title and attribute searches
|
||||
* Fuzzy matching requires tokens of at least 3 characters
|
||||
* Searched note content is limited to 10MB per note to prevent performance issues
|
||||
* Notes exceeding this limit will still be included in title and attribute searches
|
||||
* Fuzzy matching requires tokens of at least 3 characters
|
13
docs/User Guide/User Guide/FAQ.md
vendored
@ -65,8 +65,9 @@ Trilium uses a progressive search strategy that includes fuzzy matching when exa
|
||||
### How can I search for notes when I'm not sure of the exact spelling?
|
||||
|
||||
Use the fuzzy search operators:
|
||||
- `#title ~= "projct"` - finds notes with titles like "project" despite the typo
|
||||
- `note.content ~* "algoritm"` - finds content containing "algorithm" or similar words
|
||||
|
||||
* `#title ~= "projct"` - finds notes with titles like "project" despite the typo
|
||||
* `note.content ~* "algoritm"` - finds content containing "algorithm" or similar words
|
||||
|
||||
### Why do some search results appear before others with lower scores?
|
||||
|
||||
@ -74,7 +75,7 @@ Trilium places exact matches before fuzzy matches. When you search for "project"
|
||||
|
||||
### How can I make my searches faster?
|
||||
|
||||
1. Use the "Fast search" option to search only titles and attributes (not content)
|
||||
2. Limit search scope using the "Ancestor" field
|
||||
3. Set a result limit to prevent loading too many results
|
||||
4. For large databases, consider archiving old notes to reduce search scope
|
||||
1. Use the "Fast search" option to search only titles and attributes (not content)
|
||||
2. Limit search scope using the "Ancestor" field
|
||||
3. Set a result limit to prevent loading too many results
|
||||
4. For large databases, consider archiving old notes to reduce search scope
|
@ -1,28 +1,10 @@
|
||||
# Error logs
|
||||
It's important to provide all available error logs together with bug reports. This page will show you how to do it.
|
||||
It's important to provide all available error logs together with bug reports.
|
||||
|
||||
## Backend logs
|
||||
There are two types of error logs, both of which are useful when reporting bugs.
|
||||
|
||||
Open [data directory](../Installation%20%26%20Setup/Data%20directory.md), go to `log` subdirectory and find the latest log file, e.g. `trilium-2022-12-14.log`. You can attach the whole file to the bug report (preferable) or open it and copy-paste only the last lines / lines you believe are relevant.
|
||||
|
||||
If you have trouble finding it the log files, there's also an in-app option in top-left menu button -> Advanced -> Show backend log.
|
||||
|
||||
## Frontend logs
|
||||
|
||||
To provide frontend logs, we need to open the Developer Console. Often the easiest way is to press <kbd>Ctrl</kbd>\-<kbd>Shift</kbd>\-<kbd>I</kbd> which should work in most browsers (and desktop app). Make sure that the error producing action happened right before you copy&paste the errors, the console is cleared on app restart.
|
||||
|
||||
If that doesn't work, then:
|
||||
|
||||
* in Trilium desktop app, go to top-left menu button -> Advanced -> Open Dev Tools
|
||||
* In Firefox/Chrome right-click anywhere in the page and click Inspect:
|
||||
|
||||

|
||||
|
||||
Once you have Dev Tools open, click on "Console" tab:
|
||||
|
||||

|
||||
|
||||
Copy-paste (or screenshot) the logs. It's better to provide not just errors, but the whole log, which might provide context while analyzing the bug.
|
||||
* <a class="reference-link" href="Error%20logs/Backend%20(server)%20logs.md">Backend (server) logs</a>
|
||||
* <a class="reference-link" href="Error%20logs/Frontend%20logs.md">Frontend logs</a>
|
||||
|
||||
## Providing sensitive data
|
||||
|
||||
|
28
docs/User Guide/User Guide/Troubleshooting/Error logs/Backend (server) logs.md
vendored
Normal file
@ -0,0 +1,28 @@
|
||||
# Backend (server) logs
|
||||
## Accessing via the backend log
|
||||
|
||||
In the <a class="reference-link" href="../../Basic%20Concepts%20and%20Features/UI%20Elements/Global%20menu.md">Global menu</a>, go to Advanced → Show backend log
|
||||
|
||||
## Location on the disk
|
||||
|
||||
Backend logs are stored on the file system. To find them, open the <a class="reference-link" href="../../Installation%20%26%20Setup/Data%20directory.md">Data directory</a>, go to the `log` subdirectory and find the latest log file, e.g. `trilium-2022-12-14.log`.
|
||||
|
||||
## Reporting backend bugs
|
||||
|
||||
You can attach the whole file to the bug report (preferable) or open it and copy-paste only the last lines / lines you believe are relevant.
|
||||
|
||||
## Customizing the retention of logs
|
||||
|
||||
The backend logs are fully managed by the Trilium server. By default the last 90 days worth of logs are kept; the logs older than that are deleted in order to reduce the space consumption.
|
||||
|
||||
It's possible to change the retention period by modifying the <a class="reference-link" href="../../Advanced%20Usage/Configuration%20(config.ini%20or%20e.md">Configuration (config.ini or environment variables)</a> via the `.ini` file:
|
||||
|
||||
```
|
||||
[Logging]
|
||||
retentionDays=7
|
||||
```
|
||||
|
||||
Or via the environment variable `TRILIUM_LOGGING_RETENTION_DAYS`.
|
||||
|
||||
> [!NOTE]
|
||||
> If you set the retention days to a low number, you might notice that not all the log files are being deleted. This is because a minimum number of logs (7 at the time of writing) is maintained at all times.
|
15
docs/User Guide/User Guide/Troubleshooting/Error logs/Frontend logs.md
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
# Frontend logs
|
||||
To provide frontend logs, we need to open the Developer Console. Often the easiest way is to press <kbd>Ctrl</kbd>\-<kbd>Shift</kbd>\-<kbd>I</kbd> which should work in most browsers (and desktop app). Make sure that the error producing action happened right before you copy&paste the errors, the console is cleared on app restart.
|
||||
|
||||
If that doesn't work, then:
|
||||
|
||||
* in Trilium desktop app, go to top-left menu button -> Advanced -> Open Dev Tools
|
||||
* In Firefox/Chrome right-click anywhere in the page and click Inspect:
|
||||
|
||||

|
||||
|
||||
Once you have Dev Tools open, click on "Console" tab:
|
||||
|
||||

|
||||
|
||||
Copy-paste (or screenshot) the logs. It's better to provide not just errors, but the whole log, which might provide context while analyzing the bug.
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 136 KiB After Width: | Height: | Size: 136 KiB |
@ -85,6 +85,7 @@ export interface OptionDefinitions extends KeyboardShortcutsOptions<KeyboardActi
|
||||
minTocHeadings: number;
|
||||
eraseUnusedAttachmentsAfterSeconds: number;
|
||||
eraseUnusedAttachmentsAfterTimeScale: number;
|
||||
logRetentionDays: number;
|
||||
firstDayOfWeek: number;
|
||||
firstWeekOfYear: number;
|
||||
minDaysInFirstWeek: number;
|
||||
|