Skip to content

Provide severity, categories and account IDs in log files #5647

Closed

Description

@jturcotte
  • Use Qt categorized logging to improve the readability and grepability of client log files
  • It should be possible to filter by category and severity to control the size of log files a bit (using Qt environment variables or command line arguments)
  • Try to make sync protocol events easy to find (special category) in the log to provide a replacement for .owncloudsync.log
  • A bit of changes to log window could also be implied, either add some filtering/search options, or removing it altogether in favor of enabling file logging and opening the file explorer in the right folder when F12 is pressed.

Activity

  1. added this to the 2.4.0 milestone on Mar 24, 2017
  2. self-assigned this
    on Mar 24, 2017
  3. SamuAlfageme commented on Mar 24, 2017

    @SamuAlfageme
    Contributor
  4. butonic commented on Apr 28, 2017

    @butonic

    If the server sent the requestID as a response header, could we add it to the log, so we can link requests between server and client logs? see https://github.com/owncloud/documentation/issues/2967

  5. jturcotte commented on Apr 28, 2017

    @jturcotte
    ContributorAuthor

    @butonic If you tell us which header to put in the log, this should be very easy to do at least for the most important WebDAV methods.

  6. butonic commented on Apr 30, 2017

    @butonic

    Not yet decided. I suppose X-OC-RequestId makes sense? Lets ask the Internet ...

    It seems Heroku allows clients to send a request id in the X-Request-ID header. That of course makes sense because the client can then already log the id even when the server fails to respond. I think this maskes more sense then letting the server generate the uuid. That might be a fallback in case no X-Request-ID header has been sent: RequestHeader setifempty X-Request-ID %{UNIQUE_ID}e in the .htaccess and in oc core we then only check X-Request-ID (see https://serverfault.com/a/797611).

    @DeepDiver1975 @PVince81 @jturcotte sounds like a plan?

  7. added
    ReadyToTest
    on May 17, 2017
  8. jturcotte commented on May 17, 2017

    @jturcotte
    ContributorAuthor

    I'm putting ReadyToTest but just any kind of QA feedback would be nice regarding the output to see if anything is missing or could be improved.

  9. SamuAlfageme commented on Jun 15, 2017

    @SamuAlfageme
    Contributor
    • I really like this whole logging concept, it's way cleaner than the previous one and super handy when it comes to track down flows and issues with them. 🎉 😊
      • It'd be really useful to provide checkboxes with the categories on the bottom part of the Log Output window to filter error/warnings and discard info messages and avoid some noise - the same I do with the Search function but limiting the info dumped to those categories (i.e. like the Capture debug messages opt.)
    • @michaelstingl pointed me today at some cases where it would also be useful to have some bits of info from every network request sent/received (redirections, SAML stuff...) - we can discuss it in the near future.
    • At least on OS X the Capture debug messages prints the same qt.qpa.cocoa.window messages in loop every few ms. Could we have them only when some change is made?. e.g.
    06-15 12:27:59:808 [ debug qt.qpa.cocoa.window ]	[ unknown ]:	[QNSView flushBackingStore:] QWidgetWindow(0x7fe140dcb0c0, name="LogBrowserWindow") 1 QRect(21,21 1878x907) QPoint(0,0)
    06-15 12:27:59:810 [ debug qt.qpa.cocoa.window ]	[ unknown ]:	[QNSView drawRect:] QWidgetWindow(0x7fe140dcb0c0, name="LogBrowserWindow") QRect(21,21 1878x907)
    06-15 12:27:59:834 [ debug qt.qpa.cocoa.window ]	[ unknown ]:	[QNSView flushBackingStore:] QWidgetWindow(0x7fe140dcb0c0, name="LogBrowserWindow") 1 QRect(21,21 1878x907) QPoint(0,0)
    06-15 12:27:59:836 [ debug qt.qpa.cocoa.window ]	[ unknown ]:	[QNSView drawRect:] QWidgetWindow(0x7fe140dcb0c0, name="LogBrowserWindow") QRect(21,21 1878x907)
    06-15 12:27:59:862 [ debug qt.qpa.cocoa.window ]	[ unknown ]:	[QNSView flushBackingStore:] QWidgetWindow(0x7fe140dcb0c0, name="LogBrowserWindow") 1 QRect(21,21 1878x907) QPoint(0,0)
    06-15 12:27:59:863 [ debug qt.qpa.cocoa.window ]	[ unknown ]:	[QNSView drawRect:] QWidgetWindow(0x7fe140dcb0c0, name="LogBrowserWindow") QRect(21,21 1878x907)
    

    This can be closed otherwise. 🏁

  10. jturcotte commented on Jun 15, 2017

    @jturcotte
    ContributorAuthor

    @SamuAlfageme Thanks for the feedback!

    About the debug messages, right now it just outputs everything, including all Qt messages. In this mode you shouldn't expect any kind of conciseness, it's only to see if you missed anything and can be filtered in an editor or to know which logging rules to apply to get what you want.

    We could add an option to set the filter rules in the log window, but the feedback I got is that many people use log files instead, or log to the console, so I would suggest that you try setting the QT_LOGGING_RULES environment variable yourself for now since this can also be used by people using log files. If many people want to use the logging window we could add some option there, but it would be less flexible than the environment variable so let's try getting used to that first.

    For rules, the logging verbosity is appended to the category, so in your example above, this specific debug could be disabled with qt.qpa.cocoa.window.debug=false (and keep qt.qpa.cocoa.window.info, qt.qpa.cocoa.window.warning etc active, if any).
    Here are a few examples that could also address your other comments:

    • QT_LOGGING_RULES="qt.*=true;*.debug=true"
      This is equivalent to the checkbox or the --logdebug command line switch (and is also shown for reference if you do --help).
    • QT_LOGGING_RULES="sync.*=true;gui.*=true"
      This is everything from the client, including debug, but without qt.*. sync and gui are the only two top-level categories, so you can use them to include anything that is not Qt.
    • QT_LOGGING_RULES="sync.*=true;gui.*=true;*.debug=false"
      The default rules are equivalent to this, it's the same as not setting QT_LOGGING_RULES nor passing --logdebug.
    • QT_LOGGING_RULES="*.info=false;sync.networkjob.*.info=true"
      Disable all info messages already enabled by the default rules and then re-enable all subcategories of sync.networkjob (without sync.networkjob itself because of the dot before the *). This somewhat gives you list of HTTP requests done.

    Or any tweak of those that would fit your need better, let me know if it doesn't work.

    You can probably also grep logs provided by customers with similar rules, the difference is that the verbosity appears separately before. This could be altered temporarily using something like QT_MESSAGE_PATTERN="%{time MM-dd hh:mm:ss:zzz} [ %{category}.%{type} ]: %{message}" if you want the verbosity at the end of the category like for rules.

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

Metadata

Metadata

Assignees

Labels

ReadyToTest

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions