Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Where an aio-logger output at systemd? #3

Open
leichgardt opened this issue May 24, 2021 · 1 comment
Open

Where an aio-logger output at systemd? #3

leichgardt opened this issue May 24, 2021 · 1 comment

Comments

@leichgardt
Copy link

I'm trying to use aiologger in my service but I don't see the output of AsyncStreamHandler into $ journalctl -u my.service.
When I was running my project $ python main.py of course I could see the logger output.

What do I need to do for journalctl aio-logging?

system: ubuntu 20.04
python: 3.8

@meskio
Copy link

meskio commented Dec 21, 2022

I'm having problems also with aiologger and journald. Using a simple example:

import asyncio
from aiologger import Logger


async def main():
    logger = Logger.with_default_handlers(name='my-logger')

    count=0
    while count<10:
        await logger.info(f"{count}")
        count+=1

    await logger.shutdown()


loop = asyncio.get_event_loop()
loop.run_until_complete(main())
loop.close()

And run it with systemd:

systemd-run ./log.py

I see the first 0, but the rest of attempts to log give an error:

pipe closed by peer or os.write(pipe, data) raised exception.

The application I'm working on freezees when calling the logger. But I didn't manage to produce a simple example to reproduce it.

Can it be related to #4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants