- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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,
Dennes
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi, @v-nikhilan-msft ,
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello, I am trying the same, did it work for you? Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you, this seems great!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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

Helpful resources
Join us at the Microsoft Fabric Community Conference
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Fabric Monthly Update - February 2025
Check out the February 2025 Fabric update to learn about new features.

Subject | Author | Posted | |
---|---|---|---|
11-05-2024 01:08 AM | |||
07-15-2024 11:58 AM | |||
01-22-2025 01:44 AM | |||
11-15-2024 06:19 AM | |||
01-15-2025 08:38 PM |
User | Count |
---|---|
26 | |
3 | |
3 | |
2 | |
2 |
User | Count |
---|---|
12 | |
8 | |
7 | |
5 | |
4 |