Skip to content
Snippets Groups Projects
Select Git revision
  • 6c960fa97a9a98911cc27310867dd307ce772912
  • master default protected
  • test-pytango-10.0.3
  • revert-cs032-ccd-ip
  • deploy-components-parallel
  • fix-chrony-exporter
  • L2SS-2407-swap-iers-caltable-monitoring-port
  • L2SS-2357-fix-ruff
  • sync-up-with-meta-pypcc
  • stabilise-landing-page
  • all-stations-lofar2
  • v0.39.7-backports
  • Move-sdptr-to-v1.5.0
  • fix-build-ubuntu
  • tokens-in-env-files
  • fix-build
  • L2SS-2214-deploy-cdb
  • fix-missing-init
  • add-power-hardware-apply
  • L2SS-2129-Add-Subrack-Routine
  • Also-listen-internal-to-rpc
  • v0.55.5-r2 protected
  • v0.52.8-rc1 protected
  • v0.55.5 protected
  • v0.55.4 protected
  • 0.55.2.dev0
  • 0.55.1.dev0
  • 0.55.0.dev0
  • v0.54.0 protected
  • 0.53.2.dev0
  • 0.53.1.dev0
  • v0.52.3-r2 protected
  • remove-snmp-client
  • v0.52.3 protected
  • v0.52.3dev0 protected
  • 0.53.1dev0
  • v0.52.2-rc3 protected
  • v0.52.2-rc2 protected
  • v0.52.2-rc1 protected
  • v0.52.1.1 protected
  • v0.52.1 protected
41 results

jupyter-notebook

Blame
  • Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    jupyter-notebook 1009 B
    #!/usr/bin/python3
    # -*- coding: utf-8 -*-
    # An adjustment of the `jupyter-notebook' executable patched to:
    #  - log to the ELK stack
    #
    # We go straight for the notebook executable here, as the "jupyter" command
    # execvp's into the requested notebook subcommand, erasing all configuration
    # we set here.
    import re
    import sys
    
    from notebook.notebookapp import main 
    
    from logstash_async.handler import AsynchronousLogstashHandler, LogstashFormatter
    import logging
    
    if __name__ == '__main__':
        # log to the tcp_input of logstash in our ELK stack
        handler = AsynchronousLogstashHandler("elk", 5959, database_path='/tmp/pending_log_messages.db')
    
        # add to logger of Jupyter traitlets Application. As that logger is configured not to propagate
        # messages upward, we need to configure it directly.
        logger = logging.getLogger("NotebookApp")
        logger.addHandler(handler)
        logger.setLevel(logging.DEBUG)
    
        sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
        sys.exit(main())