question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Allow for custom logger to be passed to ApplicationSession

See original GitHub issue

ApplicationSession does not currently allow a custom logger to be passed to the logger instance that txaio uses. It would be nice to allow a custom logger to be passed based on the standard lib logging module. This would allow for better control of a log file for administration, and not duplicate entry with no way to stop it:

[04-28-2016 15:58:32.589 UTC] PID: 1659 Mod: timer Line: 16 INFO: build_json_tree sort finished in: 0.002349 secs
2016-04-28T11:58:32 build_json_tree sort finished in: 0.002349 secs
class ApplicationSession(BaseSession):
    """
    WAMP endpoint session.
    """

    log = txaio.make_logger() or self.config.logger  # NOTE: Or something like this

    def __init__(self, config=None):
        """
        Constructor.
        """
        BaseSession.__init__(self)
        self.config = config or types.ComponentConfig(realm=u"default")
class SessionComponent(ApplicationSession):
    def __init__(self, config=None, hostname=None, logger=None):
        ApplicationSession.__init__(self, config, logger)

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:27 (12 by maintainers)

github_iconTop GitHub Comments

2reactions
oberstetcommented, Apr 29, 2016

No

1reaction
singlecheezecommented, Apr 29, 2016

Ah 😉

Read more comments on GitHub >

github_iconTop Results From Across the Web

Logging Cookbook — Python 3.11.1 documentation
Filter instances are allowed to modify the LogRecords passed to them, including adding additional attributes which can then be output using a suitable...
Read more >
Node.js Logging with Winston - Reflectoring
Introducing Node Js Developers to Logging Using Winston Loggers. ... Its formatting feature allows us to customize logged messages.
Read more >
Python logging: access custom logger from several files
How can I declare a custom logger with custom logging method in the main.py and then use the same object (!) in all...
Read more >
Application Session Management - Auth0
Let's see how to maintain application sessions in different scenarios. ... Application Session Layer Logout: Logging users out of your ...
Read more >
openid logout
Develop scalable, custom business apps with low-code development or give your ... your application session and also the session of Azure AD gets...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found