1

I've set up a django echo server, used for internal uses only. because of this, I run the server with manage.py runserver & (yeh, I know, the development mode) with the & so it will keep running in the background. Lately the server always stops working without any notices or error messages. When I type jobs to see the current job, it status is Exit 247. Any idea why this happens? I looked online and no help.

orr
  • 129
  • 10

2 Answers2

0

According to this issue, code 247 is due to an overconsumtion of memory.

@BetonZM is right, configuring logging is always helpful.

You can also use > to redirect the standard output to a file when using &.

Le Minaw
  • 835
  • 7
  • 17
  • Yes I saw it, but for some reason I thought it is not connected. I will dig into it more now. – orr Jan 30 '21 at 19:24
-1

When using anything in background it is always recommended to log errors.

To log into file just add these lines into settings.py

LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'handlers': {
    'file': {
        'level': 'ERROR',
        'class': 'logging.FileHandler',
        'filename': os.path.join(BASE_DIR,'APPNAME.log'),
    },
},
'loggers': {
    'django': {
        'handlers': ['file'],
        'level': 'ERROR',
        'propagate': True,
    },
},
}

I hope this helps you find your problem!