Forum Discussion
DennesTorres
2 years agoImpactful Individual
Notebook Logs
Hi, We can link a workspace with log analytics, I did with mine. How could I from a notebook generate a log which is recorded in the log analytics linked to the workspace ? Kind Regards, ...
- Anonymous2 years ago
Hi DennesTorres
Thanks for using Fabric Community.
You can add a code cell in your notebook as follows:// Test log4j MDC/NDC // https://github.com/mspnp/spark-monitoring/issues/28 import org.apache.log4j.MDC val LOGGER_PREFIX = "[Gluten]" val logger = org.apache.log4j.LogManager.getLogger(LOGGER_PREFIX + " " + "com.contoso.LoggerExample") logger.info("Hello, info message") logger.warn("Hello, warn message") logger.error("Hello, error message")
You can validate the log here:
Hope this helps. Please let me know if you have any further queries.
Anonymous
2 years agoNot applicable
Hi DennesTorres
Thanks for using Fabric Community.
You can add a code cell in your notebook as follows:
// Test log4j MDC/NDC
// https://github.com/mspnp/spark-monitoring/issues/28
import org.apache.log4j.MDC
val LOGGER_PREFIX = "[Gluten]"
val logger = org.apache.log4j.LogManager.getLogger(LOGGER_PREFIX + " " +
"com.contoso.LoggerExample")
logger.info("Hello, info message")
logger.warn("Hello, warn message")
logger.error("Hello, error message")
You can validate the log here:
Hope this helps. Please let me know if you have any further queries.
Anonymous
2 years agoNot applicable
Hi DennesTorres
We haven’t heard from you on the last response and was just checking back to see if your query got resolved. Otherwise, will respond back with the more details and we will try to help.
Thanks