Skip to content
Snippets Groups Projects
Select Git revision
  • 041c13d420072ae644dda5bec0605e1de7df378a
  • master default protected
  • control-single-hba-and-lba
  • stabilise-landing-page
  • all-stations-lofar2
  • L2SS-2357-fix-ruff
  • 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
  • fix-build-dind
  • L2SS-2153--Improve-Error-Handling
  • L2SS-2153-Add-Grpc-Gateway-support
  • L2SS-1970-apsct-lol
  • DNM-pytango10.0.1rc1-test
  • 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
  • v0.52.1-rc1 protected
  • v0.51.9-6 protected
  • v0.51.9-5 protected
  • v0.51.9-4 protected
  • v0.51.9-3 protected
  • v0.51.9-2 protected
  • v0.51.9-1 protected
  • v0.51.9 protected
  • v0.51.8 protected
  • v0.39.15-wsrttwo protected
  • v0.39.15-wsrt 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())