In ArcGIS Online Notebooks (Standard) how is python logging handled?
Local Notebooks (ArcGIS Pro) has documentation on logging practices but they seem not to apply to the AGOL version. As expected, I have not found any entries in the AGOL Activity Log.
Solved! Go to Solution.
If you don't specify a path for your log file, then by default ArcGIS Online Notebooks will log to standard out, and you will see your log messages appear in the output cell. (Note that the default log level is warning, so you will only see log messages in the output cell that are of level warning or higher.)
You can use logging.baseConfig() to specify a file in which to store your logging messages instead. You can also adjust the logging level, if you want to see messages from other levels. For example,
import logging
logging.basicConfig(
filename = r'/arcgis/home/example.log',
level = logging.DEBUG
)
logging.debug('A DEGBUG log message.')
If you don't specify a path for your log file, then by default ArcGIS Online Notebooks will log to standard out, and you will see your log messages appear in the output cell. (Note that the default log level is warning, so you will only see log messages in the output cell that are of level warning or higher.)
You can use logging.baseConfig() to specify a file in which to store your logging messages instead. You can also adjust the logging level, if you want to see messages from other levels. For example,
import logging
logging.basicConfig(
filename = r'/arcgis/home/example.log',
level = logging.DEBUG
)
logging.debug('A DEGBUG log message.')
For my fellow neophytes - uploading and downloading files to the AGOL Notebooks workspace:
https://doc.arcgis.com/en/arcgis-online/create-maps/work-with-content-in-a-user-workspace.htm