Tracer Logger | MonetDB Docs (2024)

Tracer is the general logging system for the MonetDB stack, modelled after other well-known logging schemes (e.g: Python).It provides a number of logging levels and options to increase or reduce the verbosityeither of individual parts of the code or of the codebase as a whole.It allows users to focus on logging messages related to certain steps of execution, in order to aid debugging.The behaviour of Tracer can be controlled at runtime using a SQL API designed for that purpose.

Log Levels

Tracer supports the following logging levels with the following order: CRITICAL > ERROR > WARNING > INFO > DEBUG.

Components

MonetDB is built upon three different layers SQL, MAL and GDK.Each layer consists of certain components.For instance, SQL layer involves “SQL MVC”, “SQL optimizer” and many more.However, not all the components need to belong to a single layer.There are components that target the whole stack, such as memory allocation, I/O and threads orMonetDB modules like lidar, fits and bam, that fall under a more general category.Tracer introduces the concept of “component logging” where each component can be in a different logging level.The list of the available components is the following:

  • ACCELERATOR
  • ALGO
  • ALLOC
  • BAT_
  • CHECK_
  • DELTA
  • HEAP
  • IO_
  • PAR
  • PERF
  • TEM
  • THRD
  • GEOM
  • FITS
  • SHP
  • SQL_PARSER
  • SQL_TRANS
  • SQL_REWRITER
  • SQL_EXECUTION
  • SQL_STORE
  • MAL_WLC
  • MAL_REMOTE
  • MAL_MAPI
  • MAL_SERVER
  • MAL_OPTIMIZER
  • GDK

Layers

Tracer provides a way for 1) manipulating massively the logging level of the componentsdepending on the layer they belong to and 2) setting all the components to a certain level of verbosity.In the following list you can find the available layers that Tracer supports:

  • SQL_ALL Sets SQL layer
  • MAL_ALL Sets MAL layer
  • GDK_ALL Sets GDK layer
  • MDB_ALL Sets all the components (MonetDB codebase)

Adapters

Tracer introduces the concept of adapters in MonetDB stack.Simply, an adapter determines where the logging messages will be output.MonetDB, for now, supports only one adapter, but more will come in the future.Below you can find the supported adapters along with a brief explanation.

BASIC: Writes all the logging messages produced to the log file “mdbtrace.log”.The file is created by default in the DB path directory, however, as it’s mentioned later onyou have the option to specify the desired path on startup.

Moreover any produced logging messages with level greater than orequal to WARNING (i.e. WARNING, ERROR, and CRITICAL) willalways be written in the standard error of the mserver5process. This means that when the database is started using monetdbdthese messages will appear in merovingian.log (see the monetdbd manpage).

For long running production deployments this duplication can produce alot of wasted disk space, especially if log rotation is not used. Inorder to avoid that situation if the user has not specified anyinitialization parameters for Tracer, it will only output thesemessages in standard error. Specifically this means that if nologging level changes for any of the components and no output filehave been specified “mdbtrace.log” will be empty.

Log Rotation

Tracer is compatible with the logrotate utility.Sending a SIGHUP to “mserver5” will cause Tracer to reopen “mdbtrace.log” if the BASIC adapter is used.

Setting Custom Directory For Traces

Using directly mserver5: In order to use a different file than the default “mdbtrace.log” in the DB path to store the produced traces, you can simply start mserver5 with the option “--dbtrace=”.

Using merovingian (monetdbd): In order to use a different file than the default “mdbtrace.log” DB path in order to store the produced traces, you can use monetdb program and set the variable ‘dbtrace’. For instance: ‘monetdb set dbtrace /tmp/mydb_trace.log mydb’.

Tracer Control

Tracer comes with a number of SQL procedures which can be called at the user level to control the tracing. Using the mclient program, you can simply execute CALL logging.*(...); in order to interact with the logging system.

  • logging.flush()

    Tracer uses a buffer under the hood where it stores all the logs until reaching 64KB. After that point, a flush buffer operation is performed automatically. However, in case your messages remain in the buffer because e.g: you have too few logging messages, you can always perform this call in order to flush the buffer explicitly. The log messages are getting outputted to the active adapter at that moment.

  • logging.setcomplevel(str comp, str level)

    Sets the log level for a specific component.

  • logging.resetcomplevel(str comp)

    Resets the log level for a specific component back to the default (ERROR).

  • logging.setlayerlevel(str layer, str level)

    Sets the log level for a specific layer

  • logging.resetlayerlevel(str layer)

    Resets the log level for a specific layer back to the default (ERROR).

  • logging.setflushlevel(str level)

    Sets the flush level. A flush level determines the importance of a certain logging level. When an important message comes to the logger which has the same logging level as the flush level, Tracer will be triggered to flush the buffer. Tracer by default will always decide to flush CRITICAL and ERROR messages no matter the flush level is set.

  • logging.resetflushlevel()

    Resets the flush level back to the default (INFO).

  • logging.setadapter(str adapter)

    Sets the adapter that Tracer is going to use in order to output the logging messages.

  • logging.resetadapter()

    Resets the adapter back to the default (BASIC).

  • SELECT * FROM logging.compinfo;

    Executing this query will retrieve all the available components along with their id and the logging level that has been set.

Developers

If you are a MonetDB developer/enthusiast and you would like to contribute in the logging system ofMonetDB by either introducing new layers, components or logging levels,then 'gdk/gdk_tracer.h' and 'gdk/gdk_tracer.c' are the files you are looking for!

Tracer Logger | MonetDB Docs (2024)

References

Top Articles
Hilton Head Island Maps - Guide to local attractions and Hilton Head plantation resort areas, including Hilton Head Plantation, Palmetto Dunes Plantation, Port Royal Plantation, Sea Pines Plantation, Shelter Cove Marina, Shipyard Plantation, Daufuskie Isl
Rapid Identity Tempe Union
Radikale Landküche am Landgut Schönwalde
Tiny Tina Deadshot Build
Skyward Houston County
Urist Mcenforcer
Wordscapes Level 5130 Answers
Ati Capstone Orientation Video Quiz
Beds From Rent-A-Center
Steve Strange - From Punk To New Romantic
Regular Clear vs Low Iron Glass for Shower Doors
Capitulo 2B Answers Page 40
Espn Horse Racing Results
Carolina Aguilar Facebook
Billionaire Ken Griffin Doesn’t Like His Portrayal In GameStop Movie ‘Dumb Money,’ So He’s Throwing A Tantrum: Report
Noaa Ilx
Craigslist Southern Oregon Coast
Where Is The Nearest Popeyes
Earl David Worden Military Service
Melendez Imports Menu
What Time Does Walmart Auto Center Open
Greenville Sc Greyhound
Del Amo Fashion Center Map
Pawn Shop Moline Il
Spectrum Outage in Queens, New York
The Procurement Acronyms And Abbreviations That You Need To Know Short Forms Used In Procurement
Solo Player Level 2K23
Publix Coral Way And 147
Kelley Fliehler Wikipedia
Halsted Bus Tracker
Napa Autocare Locator
6465319333
Where Can I Cash A Huntington National Bank Check
Gas Prices In Henderson Kentucky
Where Do They Sell Menudo Near Me
Tmka-19829
Gpa Calculator Georgia Tech
Cdcs Rochester
Craigslist Lakeside Az
Courtney Roberson Rob Dyrdek
Sallisaw Bin Store
Craigslist Woodward
Air Sculpt Houston
Rise Meadville Reviews
Congruent Triangles Coloring Activity Dinosaur Answer Key
Bama Rush Is Back! Here Are the 15 Most Outrageous Sorority Houses on the Row
Billings City Landfill Hours
Ics 400 Test Answers 2022
O.c Craigslist
Competitive Comparison
Fishing Hook Memorial Tattoo
Les BABAS EXOTIQUES façon Amaury Guichon
Latest Posts
Article information

Author: Zonia Mosciski DO

Last Updated:

Views: 6124

Rating: 4 / 5 (71 voted)

Reviews: 86% of readers found this page helpful

Author information

Name: Zonia Mosciski DO

Birthday: 1996-05-16

Address: Suite 228 919 Deana Ford, Lake Meridithberg, NE 60017-4257

Phone: +2613987384138

Job: Chief Retail Officer

Hobby: Tai chi, Dowsing, Poi, Letterboxing, Watching movies, Video gaming, Singing

Introduction: My name is Zonia Mosciski DO, I am a enchanting, joyous, lovely, successful, hilarious, tender, outstanding person who loves writing and wants to share my knowledge and understanding with you.