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

Add log on disk #8791

Merged
merged 7 commits into from
May 15, 2022
Merged

Add log on disk #8791

merged 7 commits into from
May 15, 2022

Conversation

koppor
Copy link
Member

@koppor koppor commented May 13, 2022

JabRef has a build-in logging framework. Howver, the log is hard to find and to open after JabRef has closed.

This PR adds logging to %APPDATA% using AppDirs.

The log is a rolling log and also configured for parallel writing (in case there are multiple local instances of JabRef - who knows...)

Example:

grafik

Content:

2022-05-13 08:50:57 [JavaFX Application Thread] org.jabref.logic.net.ssl.TrustStoreManager.createTruststoreFileIfNotExist()
INFO: Trust store path: C:\Users\koppor\AppData\Local\org.jabref\ssl\truststore.jks
2022-05-13 08:50:57 [JavaFX Application Thread] org.jabref.gui.JabRefMain.clearOldSearchIndices()
INFO: Deleting out-of-date fulltext search index at C:\Users\koppor\AppData\Local\org.jabref\JabRef\Cache.
2022-05-13 08:50:57 [JavaFX Application Thread] org.jabref.gui.JabRefMain.clearOldSearchIndices()
INFO: Deleting out-of-date fulltext search index at C:\Users\koppor\AppData\Local\org.jabref\JabRef\Logs.
2022-05-13 08:50:57 [JavaFX Application Thread] org.jabref.gui.theme.ThemeManager.addStylesheetToWatchlist()
INFO: Watching css C:\git-repositories\jabref\jabref\build\resources\main\org\jabref\gui\Base.css for live updates
2022-05-13 08:50:57 [JavaFX Application Thread] org.jabref.gui.theme.ThemeManager.updateThemeSettings()
INFO: Not updating theme because it hasn't changed
2022-05-13 08:50:57 [JavaFX Application Thread] org.jabref.gui.theme.ThemeManager.updateThemeSettings()
INFO: Theme set to Theme{type=DEFAULT, name=''} with base css StyleSheet{file:/C:/git-repositories/jabref/jabref/build/resources/main/org/jabref/gui/Base.css}
  • Change in CHANGELOG.md described in a way that is understandable for the average user (if applicable)
  • Tests created for changes (if applicable)
  • Manually tested changed features in running JabRef (always required)
  • Screenshots added in PR description (for UI changes)
  • Checked developer's documentation: Is the information available and up to date? If not, I outlined it in this pull request.
  • Checked documentation: Is the information available and up to date? If not, I created an issue at https://github.com/JabRef/user-documentation/issues or, even better, I submitted a pull request to the documentation repository.

@Siedlerchr
Copy link
Member

I would like to have the ability to turn this off in the preferences and maybe it's better to write to /tmp?

@koppor
Copy link
Member Author

koppor commented May 15, 2022

and maybe it's better to write to /tmp?

The directory is coming from AppDirs

grafik

On Windows, these few bytes do not matter - currently, the AppDat directory has 244 GB on my disk...

grafik

I would like to have the ability to turn this off in the preferences

@calixtus Can you support here or can we pospone that to a follow-up PR? 😇

@koppor
Copy link
Member Author

koppor commented May 15, 2022

The jdk-stirpping is explained at https://tinylog.org/v2/configuration/#strip-stack-trace-elements

@koppor
Copy link
Member Author

koppor commented May 15, 2022

Switched to SharedFileWriter to enable re-creation of the log file at each start (and to enable concurrent instances writing to the log file). Thus, the amount of disk space used should be low.

@calixtus and me fear that diving into the preferences could render logging unusable in certain situations. Therefore, we decided to always write the log.

@calixtus
Copy link
Member

Solution now: only one file is created / overwritten when starting jabref.
I think making the path of the log file editable and enabling writing a log file via the prefs is not neccessary anymore.

@calixtus calixtus merged commit d542651 into main May 15, 2022
@calixtus calixtus deleted the add-user-logging branch May 15, 2022 13:44
Siedlerchr added a commit to LIM0000/jabref that referenced this pull request May 15, 2022
* upstream/main:
  checkstye
  Default path for ssl key store is nested inside "JabRef" directory (JabRef#8796)
  Add log on disk (JabRef#8791)
  Squashed 'buildres/csl/csl-styles/' changes from 25512a5..649aac4
Siedlerchr added a commit to Christina0114/jabref that referenced this pull request May 22, 2022
* upstream/main: (109 commits)
  Fix right clicking a group and choosing "remove selected entries from this group" leads to error when Bibtex source tab is selected (JabRef#8821)
  Fix single identifier cannot be opened on click (JabRef#8838)
  Add Pubmed/Medline Query Transformer (JabRef#8818)
  adjust and add testcases for FileAnnotationViewModel (JabRef#8830)
  Append config instead of replacing (JabRef#8834)
  Fix eclipse config (JabRef#8835)
  Add Nemo file manager (JabRef#8831)
  Fix missing clear action on pressing esc within the "Filter groups" field (JabRef#8829)
  Update bouncycalse to new base version (JabRef#8827)
  add: add test cases for FileUtil (JabRef#8810)
  Restrict use of standard streams (JabRef#8816)
  updated 8802 (JabRef#8817)
  Bump pascalgn/automerge-action from 0.15.2 to 0.15.3 (JabRef#8803)
  Bump jackson-dataformat-yaml from 2.13.2 to 2.13.3 (JabRef#8804)
  Bump icu4j-charset from 70.1 to 71.1 (JabRef#8805)
  Fix notifications that overlap task bar (JabRef#8775)
  checkstye
  Default path for ssl key store is nested inside "JabRef" directory (JabRef#8796)
  Add log on disk (JabRef#8791)
  Fix for JabRef#8788 JabRef not showing contents of shared database library (JabRef#8793)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants