Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-603

Log message that says schema update deactivated should be DEBUG or INFO, not ERROR

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Minor
    • 1.0 B2
    • 0.9.840
    • Storage
    • None
    • All
    • logging log error

    Description

      In XWikiHibernateBaseStore, updateSchema method, there are two logging messages at ERROR level. Neither is an error or even a warning, so their logging level should be changed. I suggest the first one to be DEBUG, since the server isn't even doing anything when schema update is disabled and the admin would have had to turn this schema update feature off in the config file. The second one is probably INFO. There's also no particular reason for having this in a try / catch clause, especially since the exception is silently ignored. In code terms, replace:

      // No updating of schema if we have a config parameter saying so
              try {
                  if ((!force)&&("0".equals(context.getWiki().Param("xwiki.store.hibernate.updateschema")))) {
                      if (log.isErrorEnabled())
                          log.error("Schema update deactivated for wiki " + context.getDatabase());
                      return;
                  }
      
                  if (log.isErrorEnabled())
                      log.error("Schema update for wiki " + context.getDatabase());
      
              } catch (Exception e) {}
      

      With:

      if ((!force)&&("0".equals(context.getWiki().Param("xwiki.store.hibernate.updateschema")))) {
        log.info("Not updating schema: see the xwiki.store.hibernate.updateschema configuration parameter.");
        return;
      } else [
        log.info("Updating schema since xwiki.store.hibernate.updateschema is set.");
      }
      

      Attachments

        Activity

          People

            vmassol Vincent Massol
            yoavshapira Yoav Shapira
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 5 minutes
                5m
                Remaining:
                Remaining Estimate - 5 minutes
                5m
                Logged:
                Time Spent - Not Specified
                Not Specified