Skip to content

Rich macOS File Provider Logs #8546

@i2h3

Description

@i2h3

Problems

  • The current logging implementation of file providers on macOS has several drawbacks.
  • Currently only log messages are extracted without any further metadata which could be helpful.
  • The unified logging on Apple platforms is great and convenient but turns into the opposite when it is about retrieving logs.
  • The unified logging persists only certain types of messages and most only for a limited time.
  • Currently, the entries are retrieved with the OSLogStore.init(scope:) initializer which is marked as deprecated in the documentation.
  • The alternative OSLogStore.local() initializer (quoting documentation): Gaining access to the local unified logging system requires permission from the system. The caller must be run by an admin account and have the com.apple.logging.local-store entitlement. - which imposes unnecessary constraints on our app and users.

Suggestions

  • Implement a custom logging based on files in the container of the file provider extension.
  • The format should be JSON lines to enable easy parsing and flexibility in structural development.
  • Every process needs a dedicated log file for their own lifetime. Should a file provider extension be terminated and launched again later, it shall create a new file. Also, the process identifier must be taken into account because the same file provider extension is run as redundant process, at least one for each file provider domain set up (this may be changed arbitrarily by Apple any time or maybe already did to two years ago).
  • Do not reinvent the wheel, the community already thought about this standard problem and there are things like Swift Log.
  • Ship the logging implementation as part of NextcloudFileProviderKit so that gets closer to the "batteries included" claim (right now there is still too much file provider code in the NextcloudIntegration project of this repository).

Sub-issues

Metadata

Metadata

Assignees

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions