Forum Discussion
Notebook Logs
- 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.
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.
Hi, Anonymous ,
This example seems made for Databricks, I couldn't manage to make it work in Fabric.
First problem is the import: This library doesn't exist and pip install doesn't work for it as well. Is there other way to make this import work ?
I tried to work around the import in two different way:
First attempt:
What else am I missing?
Thank you in advance!
Kind Regards,
Dennes
- BlackCurrant1 year agoFrequent Visitor
Hello, I am trying the same, did it work for you? Thanks!