# Unable to log tryton using uWSGI

**URL:** <https://discuss.tryton.org/t/unable-to-log-tryton-using-uwsgi/1590>\
**Category:** Developer\
**Created:** [July 19, 2019, 10:10am UTC](https://discuss.tryton.org/t/unable-to-log-tryton-using-uwsgi/1590 "2019-07-19T10:10:06Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![prak](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/prak/32/321_2.png) [@prak](https://discuss.tryton.org/u/prak)\
**Post date:** [July 19, 2019, 10:10am UTC](https://discuss.tryton.org/t/unable-to-log-tryton-using-uwsgi/1590/1 "2019-07-19T10:10:06Z")

</div>

I am not able to generate the logs using uWSGi. Please let me know what I am doing wrong here -

1. tryton.ini

> ```
> [uwsgi]
> master = True # start in master mode
> #http = :8020 # bind to port 8000
> processes = 20 # run 4 worker processes
> virtualenv = /opt/tryton
> file = /opt/tryton/src/tryton/wsgi.py
> env = TRYTOND_CONFIG=/etc/trytond/trytond.conf
> env = TRYTOND_LOGGING_CONFIG=/etc/trytond/logconf.conf
> socket = tryton.sock
> vaccuum = true
> die-on-terms = true
> chmod-socket = 660
> 
> ```

1. logconf.conf

> ```
> [formatters]
> keys=simple
> 
> [handlers]
> keys=rotate
> 
> [loggers]
> keys=root
> 
> [formatter_simple]
> format=%(asctime)s] %(levelname)s:%(name)s:%(message)s
> datefmt=%a %b %d %H:%M:%S %Y
> 
> [handler_rotate]
> class=handlers.TimedRotatingFileHandler
> args=('/var/log/tryton/tryton.log', 'D', 1, 30)
> formatter=simple
> 
> [logger_root]
> level=INFO
> handlers=rotate
> 
> ```

1. prak@system:/var/log⟫ ls -l | grep tryton  
drwxrwxrwx 2 tryton www-data 4096 Jul 19 15:34 tryton

---

<div class="post-metadata">

**Author:** ![pokoli](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/pokoli/32/22_2.png) [@pokoli](https://discuss.tryton.org/u/pokoli)\
**Post date:** [July 19, 2019, 10:36am UTC](https://discuss.tryton.org/t/unable-to-log-tryton-using-uwsgi/1590/2 "2019-07-19T10:36:01Z")

</div>

> [@prak](#):
>
> prak@system:/var/log⟫ ls -l | grep tryton  
> drwxrwxrwx 2 tryton www-data 4096 Jul 19 15:34 tryton

You should have a tryton.log inside this folder with the logging messages.

Make sure that your server is running with the tryton user so it’s able to write on this folder.

---

<div class="post-metadata">

**Author:** ![prak](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/prak/32/321_2.png) [@prak](https://discuss.tryton.org/u/prak)\
**Post date:** [January 21, 2020, 11:55am UTC](https://discuss.tryton.org/t/unable-to-log-tryton-using-uwsgi/1590/3 "2020-01-21T11:55:11Z")

</div>

Opening an old topic. This still seems not to be working. Any ideas ??

---

<div class="post-metadata">

**Author:** ![ced](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/ced/32/1237_2.png) [@ced](https://discuss.tryton.org/u/ced)\
**Post date:** [January 21, 2020, 12:03pm UTC](https://discuss.tryton.org/t/unable-to-log-tryton-using-uwsgi/1590/4 "2020-01-21T12:03:41Z")

</div>

> [@prak](#):
>
> file = /opt/tryton/src/tryton/wsgi.py

I do not know what is the content of this `wsgi.py` but [you must run `trytond.application.app` to have full environment features](http://docs.tryton.org/projects/server/en/latest/topics/start_server.html#wsgi-server).

---

<div class="post-metadata">

**Author:** ![prak](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/prak/32/321_2.png) [@prak](https://discuss.tryton.org/u/prak)\
**Post date:** [January 22, 2020, 5:30am UTC](https://discuss.tryton.org/t/unable-to-log-tryton-using-uwsgi/1590/5 "2020-01-22T05:30:29Z")

</div>

Thanks @ced. This worked.

For the other members of community, the contents of the wsgi.py file are given below. This will show what I was doing wrong:

```
#from trytond.wsgi import app

from trytond.application import app
application = app

```

---

<div class="post-metadata">

**Author:** ![system](https://discuss-cdn.tryton.org/uploads/default/original/1X/c6f8ec0a40525cdcd50058c734283450a4b3d38b.png) [@system](https://discuss.tryton.org/u/system)\
**Post date:** [February 21, 2020, 5:38am UTC](https://discuss.tryton.org/t/unable-to-log-tryton-using-uwsgi/1590/6 "2020-02-21T05:38:19Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
