translate / pootle

Online translation tool
http://pootle.translatehouse.org
GNU General Public License v3.0
1.49k stars 288 forks source link

INFO logs are appearing in error.log #4045

Open dwaynebailey opened 9 years ago

dwaynebailey commented 9 years ago

Breaking out reports from #4043 by @JohnnyKing94 into individual bugs,

Since you suggested me to update Pootle to the newever version several days ago (2.7.0, no git version), so i did, but i keep having the same problem plus one more. Pootle keeps spamming my error.log in Apache with those two lines:

[Wed Sep 09 10:17:33 2015] [error] 2015-09-09 10:17:33,541 INFO Loading custom settings from '/my/path/pootle.conf'...
[Wed Sep 09 10:17:33 2015] [error] 2015-09-09 08:17:33,858 INFO Using Python PO
[Wed Sep 09 10:17:46 2015] [error] 2015-09-09 10:17:46,998 INFO Loading custom settings from '/my/path/pootle.conf'...
[Wed Sep 09 08:17:47 2015] [error] 2015-09-09 08:17:47,316 INFO Using Python PO

It is like every web user who is trying to connect to the website, Pootle loads up every time the conf... and i don't know if it's right since all my error.log is full of this

dwaynebailey commented 9 years ago

The first one is from Translate Toolkit, it doesn't have a named logger so could be that the log level by default is setup to push those to the error log. The same could apply to the Pootle errors.

@JohnnyKing94 can you paste your settings for LOGGING please since you are upgrading. If you have any in your custom config you might want to remove them and use the Pootle defaults to see if the issue goes away.

JohnnyKing94 commented 9 years ago

I didn't upgrade, I made a clean installation of it... i made a new virtualenv also...

#!/usr/bin/env python
# -*- coding: utf-8 -*-

"""Sample configuration file.

This file includes the settings that administrators will likely change.
You can find the defaults in the ``*.conf`` files for more advanced settings.

In order for this configuration changes to take effect, bear in mind that you
need to change the extension of this file from ``.conf.sample`` to ``.conf``.
"""

#
# Base
#

# Site title
POOTLE_TITLE = 'Tamriel Unlimited IT'

# Local time zone for this installation. Choices can be found here:
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
# although not all choices may be available on all operating systems.
# If running in a Windows environment this must be set to the same as your
# system time zone.
TIME_ZONE = 'UTC'

# Make this unique, and don't share it with anybody.
SECRET_KEY = 'mysecretkey'

# A list of strings representing the host/domain names that this Pootle server
# can serve. This is a Django's security measure. More details at
# https://docs.djangoproject.com/en/dev/ref/settings/#allowed-hosts
# ALLOWED_HOSTS = [
#    '127.0.0.1',
#    'localhost',
#    '${your_server}',
#]

ALLOWED_HOSTS = ['*']

#
# Backends
#

# Database backend settings
DATABASES = {
    'default': {
        # Replace 'sqlite3' with 'postgresql_psycopg2' or 'mysql'.
        'ENGINE': 'django.db.backends.mysql',
        # Database name or path to database file if using sqlite3.
        'NAME': 'mydb',
        # Not used with sqlite3.
        'USER': 'myuser',
        # Not used with sqlite3.
        'PASSWORD': 'mypassword',
        # Set to empty string for localhost. Not used with sqlite3.
        'HOST': '',
        # Set to empty string for default. Not used with sqlite3.
        'PORT': '',
        # See https://docs.djangoproject.com/en/1.6/topics/db/transactions/
        # required for Django 1.6 + sqlite
        'ATOMIC_REQUESTS': True,
    }
}

# Cache Backend settings

# For more information, check
# http://docs.djangoproject.com/en/dev/topics/cache/#setting-up-the-cache
# and http://niwibe.github.io/django-redis/
#CACHES = {
#    'default': {
#        'BACKEND': 'django_redis.cache.RedisCache',
#        'LOCATION': 'redis://127.0.0.1:6379/1',
#        'TIMEOUT': 60,
#    },
#    'redis': {
#        'BACKEND': 'django_redis.cache.RedisCache',
#        'LOCATION': 'redis://127.0.0.1:6379/2',
#        'TIMEOUT': None,
#    },
#    'stats': {
#        'BACKEND': 'django_redis.cache.RedisCache',
#        'LOCATION': 'redis://127.0.0.1:6379/3',
#        'TIMEOUT': None,
#    },
#    'exports': {
#        'BACKEND': 'django.core.cache.backends.filebased.FileBasedCache',
#        'LOCATION': working_path('exports/'),
#        'TIMEOUT': 259200,  # 3 days.
#    },
#}

#
# Logging
#

# The directory where Pootle writes its logs
POOTLE_LOG_DIRECTORY = working_path('log')

#
# Site
#

# This Pootle server admins
ADMINS = (
    ('JohnnyKing', 'myemail'),
)

# Mail settings

# Default email address to use for messages sent by Pootle.
# https://docs.djangoproject.com/en/dev/ref/settings/#default-from-email
DEFAULT_FROM_EMAIL = 'noreply@tamrielunlimited.it'

# Address to receive messages sent by contact form.
POOTLE_CONTACT_EMAIL = 'support@tamrielunlimited.it'
POOTLE_CONTACT_ENABLED = False

# Email address to report string errors to, unless a report email was set for
# the project for which the string error is being reported.
# Use this as a way to forward string error reports to an address
# different from the general contact address.
POOTLE_CONTACT_REPORT_EMAIL = 'support@tamrielunlimited.it'

# Mail server settings

# By default Pootle uses the SMTP server on localhost. If the server is not
# configured for sending emails, uncomment and use these settings to setup an
# external outgoing SMTP server.

# Example for Google as an external SMTP server
EMAIL_HOST_USER = 'myemail'
EMAIL_HOST_PASSWORD = 'mypassword'
EMAIL_HOST = 'smtp.mandrillapp.com'
EMAIL_PORT = 587
EMAIL_USE_TLS = True

#
# Translation
#

# The directory where the translation files are kept
POOTLE_TRANSLATION_DIRECTORY = working_path('translations')

# Two-tuple defining the markup filter to apply in certain textareas.
#
# - Accepted values for the first element are 'textile', 'markdown',
#   'restructuredtext' and None.
# - The second element should be a dictionary of keyword arguments that will be
#   passed to the markup function.
#
# IMPORTANT: If you want to use one of these markup filters you must install on
# your own the required packages.
#
# Examples:
#    POOTLE_MARKUP_FILTER = (None, {})
#    POOTLE_MARKUP_FILTER = ('markdown', {'safe_mode': 'escape'})
#    POOTLE_MARKUP_FILTER = ('restructuredtext', {
#                                'settings_overrides': {
#                                    'report_level': 'quiet',
#                                }
#                            })
POOTLE_MARKUP_FILTER = (None, {})

# Set the backends you want to use to enable translation suggestions through
# several online services. To disable this feature completely just comment all
# the lines to set an empty list [] to the POOTLE_MT_BACKENDS setting.
#
# The second parameter for each backend option is the API key, which will
# be used in case the service supports using an API key.
#
# Available options are:
# 'APERTIUM': Apertium service.
#             For this service you need to set the API key.
#             Get your key at http://api.apertium.org/register.jsp
# 'GOOGLE_TRANSLATE': Google Translate service.
#             For this service you need to set the API key.
#             Note that Google Translate API is a paid service
#             See more at https://cloud.google.com/translate/v2/pricing
#
POOTLE_MT_BACKENDS = [
#        ('APERTIUM', ''),
#        ('GOOGLE_TRANSLATE', ''),
        ('YANDEX_TRANSLATE', 'mykey'),
]
dwaynebailey commented 9 years ago

OK if this is a clean install then its related to some of our default settings for logging

JohnnyKing94 commented 8 years ago

After swtiching from http to https, i also want to report this useless log in apache error.log

[Sun Sep 25 19:50:47.994831 2016] [wsgi:error] [pid 27721] 2016-09-25 19:50:47,994 INFO Starting new HTTPS connection (1): tamrielunlimited.it
[Sun Sep 25 19:50:48.277405 2016] [wsgi:error] [pid 27721] 2016-09-25 19:50:48,277 INFO Starting new HTTPS connection (1): tamrielunlimited.it
[Sun Sep 25 19:57:35.479547 2016] [wsgi:error] [pid 27722] 2016-09-25 19:57:35,479 INFO Starting new HTTPS connection (1): tamrielunlimited.it
[Sun Sep 25 19:57:35.924541 2016] [wsgi:error] [pid 27722] 2016-09-25 19:57:35,924 INFO Starting new HTTPS connection (1): tamrielunlimited.it
[Sun Sep 25 19:58:26.554016 2016] [wsgi:error] [pid 27721] 2016-09-25 19:58:26,553 INFO Starting new HTTPS connection (1): tamrielunlimited.it
[Sun Sep 25 19:58:27.388512 2016] [wsgi:error] [pid 27721] 2016-09-25 19:58:27,388 INFO Starting new HTTPS connection (1): tamrielunlimited.it
JohnnyKing94 commented 7 years ago

After several months, with the last versions of pootle. i have even these outputs in my error.log

[Sun Feb 05 16:59:03.041435 2017] [wsgi:error] [pid 24188] [2017-02-05T16:59:03]\tjuri.ceragioli\tSC\t1.2\tS\t#855219\tNS=3\tS=0\t(total: 436.052688399)
[Sun Feb 05 16:59:03.041482 2017] [wsgi:error] [pid 24188] 2017-02-05 16:59:03,041 INFO juri.ceragioli\tSC\t1.2\tS\t#855219\tNS=3\tS=0\t(total: 436.052688399)
[Sun Feb 05 17:00:15.957768 2017] [wsgi:error] [pid 24188] [2017-02-05T17:00:15]\tjuri.ceragioli\tSC\t1.6\tS\t#2855\tNS=4\tS=0\t(total: 437.252688399)
[Sun Feb 05 17:00:15.957818 2017] [wsgi:error] [pid 24188] 2017-02-05 17:00:15,957 INFO juri.ceragioli\tSC\t1.6\tS\t#2855\tNS=4\tS=0\t(total: 437.252688399)
JohnnyKing94 commented 7 years ago

Now it's totally trash the error.log, i can't find useful errors... there are so many lines of people translating on my site 😄