Skip to content
  • Products
    • MicroStream for Java
    • MicroStream for Android
    • MicroStream Serialization
  • Community
    • GitHub
    • Discussion
    • Contribute
    • Issues
    • StackOverflow
  • Editions
    • MicroStream Enterprise Edition
    • Edition Comparison
  • Resources
    • Get Started
    • Docs
    • Examples
    • Videos
    • Blog
    • Release & Update Plan
    • Edition Comparison
  • Services
    • Support
    • Training
  • Company
    • About us
    • Contact
    • Imprint
  • Subscribe to our Newsletter
  • User icon Sign in

Cookie

We use cookies to make it easier to use and to further improve our service.

If you have given us your consent, you can revoke it at any time in the data protection declaration.

Use all cookies Manage cookies Reject cookies

Cookie

?
?
?
Use all cookiessave settingsReject cookiesView Privacy Policy

Necessary

Necessary cookies help make a website usable by enabling basic functions such as page navigation and access to secure areas of the website. The website cannot function properly without these cookies.

Name Anbieter Zweck Ablauf Typ
c3kie_removeCookieWindow microstream.one Saves the consent status of the user whether the cookie window should be displayed. 1 Jahr HTML Local Storage
c3kie_googleAnalytics microstream.one Saves the consent status of the user as to whether Google Analytics is allowed to run. 1 Jahr HTML Local Storage
c3kie_googleAnalytics microstream.one Saves the consent status of the user as to whether Google Analytics is allowed to run. 1 Jahr HTML Local Storage
c3kie_tagManager microstream.one Saves the consent status of the user as to whether Google Tag Manager is allowed to run. 1 Jahr HTML Local Storage
c3kie_facebook microstream.one Saves the consent status of the user as to whether Facebook is allowed to run. 1 Jahr HTML Local Storage
c3kie_matomo microstream.one Saves the consent status of the user as to whether Matomo is allowed to run. 1 Jahr HTML Local Storage
c3kie_youtube microstream.one Saves the consent status of the user as to whether YouTube is allowed to run. 1 Jahr HTML Local Storage

Statistics

Statistics cookies help website owners understand how visitors interact with websites by collecting and reporting information anonymously.

Name Anbieter Zweck Ablauf Typ
_dc_gtm_ Google Used by Google Analytics to limit the request rate. 1 Jahr HTTP Cookie
_gid_ Google Registers a unique ID that is used to generate statistical data on how the visitor uses the website. 2 Jahre HTTP Cookie
_gcl_au Google Used to send data to Google Analytics about the device and visitor behavior. Captures the visitor across devices and marketing channels. Session Pixel Tracker
_gat_ Google Used to store a unique user ID. 1 Tag HTTP Cookie
_gat_gtag_UA_ Google Used to store a unique user ID. 1 Tag HTTP Cookie
yt-player-headers-readable YouTube Used to determine the optimal video quality based on the visitor's device and network settings. Persistent HTML Local Storage

Marketing

Marketing cookies are used to track visitors across websites. The intent is to show ads that are relevant and engaging to the individual user, making them more valuable to publishers and third party advertising providers.

Name Anbieter Zweck Ablauf Typ
VISITOR_INFO1_LIVE YouTube Tries to estimate the range of users on pages with built-in YouTube videos. 179 Tage HTTP Cookie
YSC YouTube Registers a unique ID to keep statistics on which videos from YouTube the user has seen. Session HTTP Cookie
yt.innertube::nextId YouTube Registers a unique ID to keep statistics on which videos from YouTube the user has seen. Persistent HTML Local Storage
yt.innertube::requests YouTube Registers a unique ID to keep statistics on which videos from YouTube the user has seen. Persistent HTML Local Storage
ytidb::LAST_RESULT_ENTRY_KEY YouTube Saves the user's video player settings with embedded YouTube video. Persistent HTML Local Storage
yt-remote-cast-available YouTube Saves the user's video player settings with embedded YouTube video. Session HTML Local Storage
yt-remote-cast-installed YouTube Saves the user's video player settings with embedded YouTube video. Session HTML Local Storage
yt-remote-connected-devices YouTube Saves the user's video player settings with embedded YouTube video. Persistent HTML Local Storage
yt-remote-device-id YouTube Saves the user's video player settings with embedded YouTube video. Persistent HTML Local Storage
yt-remote-fast-check-period YouTube Saves the user's video player settings with embedded YouTube video. Session HTML Local Storage
yt-remote-session-app YouTube Saves the user's video player settings with embedded YouTube video. Session HTML Local Storage
yt-remote-session-name YouTube Saves the user's video player settings with embedded YouTube video. Session HTML Local Storage

Logging Feature of MicroStream Version 7

May132022
BlogMicroStream-Version-7

With version 7 of MicroStream, there was the addition of logging statements throughout the codebase. These logging statements give you feedback on the important lifecycle actions that are performed by the MicroStream components. And can help you identify the low-level steps that are performed when reading or storing Java objects from the data storage.

We have chosen to perform the logging through the SLF4J framework. This allows you as a developer to integrate it into the logging of your choice in your project. It also has a very good backward compatibility strategy so that you don’t need to use the exact same version of the framework that we have used in the MicroStream codebase.

What is Logged?

There are two sets of actions logged by the MicroStream code. The first set is about the lifecycle of the components. When the Embedded Data Storage, Type Manager, Lazy Reference Manager, etc .. is started and stopped, this info is shown with level INFO.

This gives you an idea of when the initialization and shutdown take place for example and can give you some indications if multiple managers are started that might not be the intention of your code.

The second group of events is the low-level actions that are performed. When data is read from the storage, types are looked up, buffers created or enlarged, etc… you can get a message for each of them. These low-level information messages are mainly interesting for our development team but can also be beneficial for you as a developer using the MicroStream project. They can be used to tune the system for optimal performance for example.

This information is shown with level DEBUG and thus by default not visible in the log. You need to adjust the log level so that they appear. We don’t recommend this setting in production as there will be many messages that will affect the performance of the application.

Configuring the Log

For those that already make use of the SLF4J logging facade, you are already familiar with how you should use it. The SLF4J project doesn’t perform the actual logging and delegates this to the Java Util Logging of the JVM, Log4J, Logback, the SLF4J simple implementation, or any other library that implements the API and can be discovered using the binding mechanism.

So the configuration depends on the library that you have chosen for your project. Each of them allows you to configure the log level for a certain package using a configuration file or programmatically.

When using the LogBack library and the configuration is performed through an XML file, the following line will result in having all MicroStream log messages in the log.

hilite.me converts your code snippets into pretty-printed HTML format, easily embeddable into blog posts, emails and websites.

Just copy the source code to the left pane, select the language and the color scheme, and click “Highlight!”. The HTML from the right pane can now be pasted to your blog or email, no external CSS or Javascript files are required.

<logger name="one.microstream" level="DEBUG" />

No Log Messages Wanted

Of course, it is also possible to disable the log messages completely. The way you can do this depends if you already make use of SLF4J in your project or not.

In case you use SLF4J and a specific logging framework, you can set the Log level to OFF to disable all messages from appearing in the log. In the situation of the XML configuration with LogBack, the following line results in disabling the logging functionality of MicroStream.

<logger name="one.microstream" level="OFF" />

When you do not make use of SLF4J yet, you will see the following lines appear on the System Error stream of the JVM.

SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.

 

This warns the user that the application contains only the API dependencies of SLF4J, coming as a transitive dependency of MicroStream itself and that no logging library is found that can write out the messages.

This doesn’t affect the functionality of MicroStream nor the application. Everything will keep on working as expected. But maybe you find the error messages annoying or your company policy indicates that such messages are not allowed in production. In that case, you can add the NOP (no-operation) artifact of SLF4J to your project. This is actually an implementation of the API but it swallows any message. It is a very small jar file of around 4000 bytes but the end result is that SLF4J is silenced.

<dependency>
   <groupId>org.slf4j</groupId>
   <artifactId>slf4j-nop</artifactId>
   <version>1.7.32</version>
</dependency>

Version number 1.7.32 is chosen here as that is the version that is used within the MicroStream codebase.

Version Mismatch?

Is there a problem when your project uses another version of SLF4J? No, there is no problem because SLF4J makes sure that all versions of the API are compatible. You might need to tweak the Maven project file a bit to make sure everything keeps on working perfectly.

The API is backward compatible, but the binding with a certain logging framework like Log4J or Logback might need a specific version range of the API before it works correctly.

Since we bring in the SLF4J API as a transitive dependency, it might be the case that Maven chooses our version of the API to include in the final artifact of your project and not the version that you have specified. Even when the version in your project is more recent than the version that is included in MicroStream. This can be easily overcome by defining the version of the SLF4J API in the dependency management section of the pom.xml file.

<dependencyManagement>
   <dependencies>
      <dependency>
         <groupId>org.slf4j</groupId>
         <artifactId>slf4j-api</artifactId>
         <version>${slf4j-version}</version>
      </dependency>
   </dependencies>
</dependencyManagement>

Having the above snippets enforces the version defined in the property `slf4j-version` for Maven. And also when this is an older 1.6.x or newer 2.0.0 version, MicroStream log messages will still appear in the log file.

Conclusion

The addition of the logging functionality within the MicroStream codebase is a small feature but can be very helpful in some scenarios. You will get more insight into what the persistence engine is doing and can be used to optimize your environment.
We have chosen SLF4J since that gives you the most flexible options for the integrations and configuration within your project. And due to the binary compatibility of the SLF4J API, there are also no version conflicts if you are using another version of this logging facade.

Category: BlogMay 13, 2022Leave a comment
Tags: loggingMicroStream

Author: Rudy De Busscher

Post navigation

PreviousPrevious post:MicroStream 7.0 ReleaseNextNext post:MicroStream at WeAreDevelopers World Congress

Related Posts

MicroStream - Revolutionizing Data Storage
Why MicroStream?
May 24, 2022
MicroStream at WeAreDevelopers World Congress
May 17, 2022
MicroStream version 7
MicroStream 7.0 Release
April 27, 2022
Devoxx-UK-2022
MicroStream at Devoxx UK 2022
April 20, 2022
The Future is Serverless – with MicroStream
April 15, 2022
MicroStream-Version-7
MicroStream 7 Overview
April 7, 2022

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Post comment

Search
Related Posts
  • MicroStream - Revolutionizing Data Storage
    Why MicroStream?
    May 24, 2022
  • MicroStream at WeAreDevelopers World Congress
    May 17, 2022
  • MicroStream-Version-7
    Logging Feature of MicroStream Version 7
    May 13, 2022
Tags
Android AWS booth Cluster Conference Data Persistence Discussion event framework free fundamentals Germany GitHub GraalVM Hackathon Heldion InfoQ Integration Java Java 17 JAVAPRO JCON JVM Con logging Micronaut MicroProfile Microservices MicroStream MicroStream 2 MicroStream 4 MicroStream 6 MicroStream Day online Open Liberty Open Source Oracle Oracle CodeOne public release San Francisco Serialization Subscription Support Training Webcast
MicroStream

Store Java Object Graphs natively, relieved of heavy-weight DBMS Dependencies. Create ultra-fast In- Memory Database Applications & Microservices with Pure Java. The Pure Java Paradigm Shift in Database Development.

Upcoming Event

May 17-18, 2022 - 09:00 - 16:00 CET. In this 2-days online live training you will learn: Functional principle, designing a suited object model,…
Read more

Platforms

  • MicroStream for Java
  • MicroStream for Android

Community

  • GitHub
  • Discussion
  • Contribute
  • Issues
  • StackOverflow
  • MeetUp

Editions

  • MicroStream Enterprise Edition
  • License Comparison

Resources

  • Get Started
  • Docs
  • Examples
  • Videos
  • Blog
  • Release plan
  • License Comparison

Services

  • Support
  • Training

Company

  • About us
  • Contact

Stay Connected

  • Twitter
  • LinkedIn
  • YouTube
  • GitHub
  • StackOverflow
  • MeetUp

Get the latest MicroStream news:

Subscribe

© 2022 MicroStream Software. All rights reserved.
  • Imprint
  • Terms of use
  • Privacy
  • Legal notice

Cookie

We use cookies to make it easier to use and to further improve our service.

If you have given us your consent, you can revoke it at any time in the data protection declaration.

Use all cookies Manage cookies Reject cookies

Cookie

?
?
?
Use all cookiessave settingsReject cookiesView Privacy Policy

Necessary

Necessary cookies help make a website usable by enabling basic functions such as page navigation and access to secure areas of the website. The website cannot function properly without these cookies.

Name Anbieter Zweck Ablauf Typ
c3kie_removeCookieWindow microstream.one Saves the consent status of the user whether the cookie window should be displayed. 1 Jahr HTML Local Storage
c3kie_googleAnalytics microstream.one Saves the consent status of the user as to whether Google Analytics is allowed to run. 1 Jahr HTML Local Storage
c3kie_googleAnalytics microstream.one Saves the consent status of the user as to whether Google Analytics is allowed to run. 1 Jahr HTML Local Storage
c3kie_tagManager microstream.one Saves the consent status of the user as to whether Google Tag Manager is allowed to run. 1 Jahr HTML Local Storage
c3kie_facebook microstream.one Saves the consent status of the user as to whether Facebook is allowed to run. 1 Jahr HTML Local Storage
c3kie_matomo microstream.one Saves the consent status of the user as to whether Matomo is allowed to run. 1 Jahr HTML Local Storage
c3kie_youtube microstream.one Saves the consent status of the user as to whether YouTube is allowed to run. 1 Jahr HTML Local Storage

Statistics

Statistics cookies help website owners understand how visitors interact with websites by collecting and reporting information anonymously.

Name Anbieter Zweck Ablauf Typ
_dc_gtm_ Google Used by Google Analytics to limit the request rate. 1 Jahr HTTP Cookie
_gid_ Google Registers a unique ID that is used to generate statistical data on how the visitor uses the website. 2 Jahre HTTP Cookie
_gcl_au Google Used to send data to Google Analytics about the device and visitor behavior. Captures the visitor across devices and marketing channels. Session Pixel Tracker
_gat_ Google Used to store a unique user ID. 1 Tag HTTP Cookie
_gat_gtag_UA_ Google Used to store a unique user ID. 1 Tag HTTP Cookie
yt-player-headers-readable YouTube Used to determine the optimal video quality based on the visitor's device and network settings. Persistent HTML Local Storage

Marketing

Marketing cookies are used to track visitors across websites. The intent is to show ads that are relevant and engaging to the individual user, making them more valuable to publishers and third party advertising providers.

Name Anbieter Zweck Ablauf Typ
VISITOR_INFO1_LIVE YouTube Tries to estimate the range of users on pages with built-in YouTube videos. 179 Tage HTTP Cookie
YSC YouTube Registers a unique ID to keep statistics on which videos from YouTube the user has seen. Session HTTP Cookie
yt.innertube::nextId YouTube Registers a unique ID to keep statistics on which videos from YouTube the user has seen. Persistent HTML Local Storage
yt.innertube::requests YouTube Registers a unique ID to keep statistics on which videos from YouTube the user has seen. Persistent HTML Local Storage
ytidb::LAST_RESULT_ENTRY_KEY YouTube Saves the user's video player settings with embedded YouTube video. Persistent HTML Local Storage
yt-remote-cast-available YouTube Saves the user's video player settings with embedded YouTube video. Session HTML Local Storage
yt-remote-cast-installed YouTube Saves the user's video player settings with embedded YouTube video. Session HTML Local Storage
yt-remote-connected-devices YouTube Saves the user's video player settings with embedded YouTube video. Persistent HTML Local Storage
yt-remote-device-id YouTube Saves the user's video player settings with embedded YouTube video. Persistent HTML Local Storage
yt-remote-fast-check-period YouTube Saves the user's video player settings with embedded YouTube video. Session HTML Local Storage
yt-remote-session-app YouTube Saves the user's video player settings with embedded YouTube video. Session HTML Local Storage
yt-remote-session-name YouTube Saves the user's video player settings with embedded YouTube video. Session HTML Local Storage