You are on page 1of 12

See discussions, stats, and author profiles for this publication at: https://www.researchgate.

net/publication/377964975

Comprehensive Evaluation of Logging Frameworks for Future Vehicle


Diagnostics

Conference Paper · June 2023


DOI: 10.4271/2023-01-1223

CITATIONS READS

0 18

5 authors, including:

Sandra Bickelhaupt Michael Hahn


Universität Stuttgart Universität Stuttgart
4 PUBLICATIONS 4 CITATIONS 39 PUBLICATIONS 228 CITATIONS

SEE PROFILE SEE PROFILE

Andrey Morozov Michael Weyrich


Universität Stuttgart Universität Stuttgart
96 PUBLICATIONS 524 CITATIONS 387 PUBLICATIONS 4,003 CITATIONS

SEE PROFILE SEE PROFILE

All content following this page was uploaded by Andrey Morozov on 08 February 2024.

The user has requested enhancement of the downloaded file.


Comprehensive Evaluation of Logging Frameworks for Future Vehicle
Diagnostics
Sandra Bickelhaupt, Michael Hahn and Nikolai Nuding – Mercedes Benz AG

Andrey Morozov, Michael Weyrich – University of Stuttgart

vehicle data on the display. Currently, the infotainment


Abstract system can also be utilized as a control center for the use and
operation of apps. By integrating third-party apps such as
More and more applications (apps) are entering vehicles. Spotify or Netflix into the infotainment system, customer
Customers would like to have in-car apps in their preference can be realized successfully [3]. Some vehicle
infotainment system, which they already use regularly on manufacturers are developing new in-house infotainment
their smartphones. Other apps with new functionalities also systems to enable among other things this integration [4].
inspire vehicle customers, but only as long as the customer These systems run on automotive High Performance
can utilize them. To ensure customer satisfaction, it is Computers (HPCs) based on different operating systems.
important that these apps work and that failures are found Thereby different apps with their underlying software
and corrected as quickly as possible. Therefore, in-car apps frameworks can be executed on automotive HPCs [5]. In
also implicate requirements for future vehicle diagnostics. comparison, other vehicle manufactures are using a special
This is because current vehicle diagnostic methods are not version of Android, called Android Automotive, for vehicles
designed for handling dynamic software failures of apps. [4]. One of the main tasks of current vehicle diagnostics is
Consequently, new diagnostic methods are needed to support to detect and store failures of components or subsystems in
the diagnosis of in-car apps. Log data are a central building the form of Diagnostic Trouble Codes (DTCs) in ECUs and
block in software systems for system health management or to read them out of the ECUs so that repairs can be initiated
troubleshooting. However, there are different types of log [6]. However, vehicle diagnostics is hardware-focused and
data and log environment setups depending on the dynamic software failures are mostly not detected by current
underlying system or software platform. Depending on that, methods. In order to ensure the functionality of apps, it is
the creation of log data takes place with different logging important to diagnose dynamic software failures in addition
approaches, leading to heterogeneous results that to static software failures, such as a communication
complicates the analysis of log data. In order to classify interruption to an app. For that reason, log data from apps
different types of log data, a taxonomy for log data is derived and their analyses can be helpful [7]. In the field of vehicle
systematically in this paper. This taxonomy is deduced from diagnostics, a survey of experts indicates that these experts
identified challenges and heterogeneity regarding logging also consider log data as a useful data source in the context
and log data. Furthermore, the taxonomy is applied to of vehicle diagnostics [8]. As the future vehicle diagnostics
evaluate four logging frameworks for vehicle diagnostics is subject to the influences of the increasing integration of
based on three software platforms that are commonly used software in the vehicle, log data can be a data source for
to operate in-car apps within vehicles: Android, AUTOSAR further analysis in order to be able to diagnose in-car apps in
Adaptive, and Java Standard Edition (SE). As these vehicles.
platforms generate different types of log data, this leads to
determining and compare the differences between these The contribution of the paper is to evaluate four logging
frameworks and their commonalities for deployment in frameworks for future vehicle diagnostics, based on the
vehicles. In addition, the evaluation offers potential starting Android, AUTOSAR Adaptive and Java platform used in
points for future work regarding the utilization of log data automotive HPCs, as well as their different kinds of log data.
for future vehicle diagnostics and related methods. Therefore, a taxonomy for log data is systematically
developed. On basis of this taxonomy, criteria are applied to
evaluate the logging frameworks. The evaluation results help
Introduction to identify what aspects can be considered when analyzing
log data for vehicle diagnostics in the future.
Vehicle attractiveness is increasingly determined by the
software in the vehicle and its functions [1]. Technical The rest of the paper is structured as follows. In Section
features of a vehicle, such as driving performance, are no “Logging, log data and challenges”, issues about the
longer the main deciding factor for some customer groups. utilization of log data and challenges around logging and log
Personalization and customization of the vehicle are data are described. Section “Taxonomy for log data”
increasingly decisive for customers. Thereby, applications illustrates the developed taxonomy for log data. Afterwards,
(apps) in the vehicle, known as in-car apps, can help to offer in Section “Automotive High Performance Computer and
flexible and valuable services for customers. In addition, Software Frameworks”, the integration of automotive High
customers more and more desire to synchronize their Performance Computers (HPCs) into vehicles and aspects
smartphone with the vehicle [2]. Until now, the infotainment about in-car apps on automotive HPCs are presented. In
system in the vehicle is a control console, for example, for addition, the three logging frameworks Android, AUTOSAR
the radio, the navigation system or for showing certain Adaptive and Java are described. In Section “Evaluation”,
the taxonomy is applied on these three frameworks for a Table 1. Overview of challenges around logging and log
comparison and results are discussed. Section “Summary data.
and Outlook” provides the conclusion and describes
directions for future work. Challenge Short description Related
work
Generation Software developers can set [9]
Logging, Log Data and Challenges print statements and logging
methods in the code to generate
different log events or log events
Landauer et al. [9] mention that various terminologies about can be generated by the system.
logging and log data are circulating through different
Quality Log quality can vary a lot, if [11]
publications. In this paper, the term logging frameworks multiple software developers
indicates that log files are generated out of software create logs in a project. This can
programs. The term log file points out that in such files log be related to, for example, the
data are stored. The terms log data and logs are used as logging aim, logging rules or
synonyms in this paper. Log data consist of a sequence of internationalization.
single- or multi-line events which are named with the term Inter- Adaption of logs to other natural [14]
log events. Event logs and log messages are synonyms for nationalization languages
log events. Inside these events there can be different Formats Log data can appear in different [11] [12]
parameters, as no unified log format exists. Terms such as formats. [15] [16]
fault, error, or failure are considered as synonyms in this Setup Log data can have different [16]
paper, basically describing a generic problem, even though setups.
there are differences between these terms in other papers, for Operation Different people use log data for [17]
example by Avizienis et al. [10]. The term failure is used various tasks and with different
within this paper hereafter. In the following sections, the interests.
utilization of log data and challenges around logging and log Analysis Big amount of logs, which make [11] [12]
data are discussed. manual log analysis almost not [18]
feasible. In addition, generation
of logs in fast rates, which
Utilization of Log Data makes efficient analysis
As described above, vehicle customers would like to use inevitable.
smartphone apps in their vehicles. In everyday life, for Appearance Log data contain intertwined [9] [12]
example, instant messaging apps are often used to dependencies and correlations
communicate immediately with other users or search which makes data preprocessing
engines provide answers to open questions [11]. However, difficult
such software systems are increasingly indispensable for Procedure Concserns where to log, what to [15] [19]
users and should be available at all time. In order to ensure log and how to log by inserting
log events in software systems.
their availability, the reliability of the underlying systems has
to be ensured. It is helpful to monitor the systems
continuously and to detect errors early on, before an app fails Generation
or major system downtimes occur. Often logs are the only One challenge, which influences the work with log data, is
data, which are available in relation to software runtime that some log events are created by print statements and
information. They are produced by logging statements, logging methods which are used by software developers [9].
which are placed by developers directly in the software Developers use these statements, for example, to understand
source code. Alternatively, the used logging framework program activities or to debug code. Besides the insertion of
produces some of them automatically. log events by developers, some of them can also be
generated directly by the underlying systems itself.
The majority of log events represent normal system
operations, for example starting or stopping of processes, Quality
virtual machines, or user accesses [9]. However, log events Another thing is that the logging statements are just as
are also produced when systems behave abnormal or when helpful as the information they provide. The quality of the
failures occur in the systems. These events are important for statements can vary a lot inside projects [11]. Related to that
forensic analysis or for system diagnostics to discover the challenge is the problem that software could be developed
roots of the problem or a bottleneck [12]. by different developers who use, for example, code sharing
platforms and do not know the original logging aim inside
Challenges Around Logging and Log the software project. Moreover, the software changes
Data continuously and new versions are released quickly. This
In the field of apps, logs can be useful to monitor the states makes manual updating of logging rules or how logging
of an app or for debugging [13]. Logs are helpful to statements are set in a project difficult for developers.
understand what an app is and was currently doing and the
sequence in which certain actions are executed. However, Internationalization
there are no clearly defined uniform guidelines for logging In addition, writing logs in different languages and their
software systems that apply to all systems [14]. For that internationalization is time-consuming and error-prone [14].
reason, nine major challenges around logging within related By adapting logs to other natural languages, developers can
work are identified. These challenges are summarized in define internationalized labels and create centralized files,
Table 1 and described in the following sections in more which store a list of predefined log event templates.
detail.
Formats forensic analysis or system diagnostic in finding root causes
Additionally, a challenge is that log events can appear in or for rankings to analyze frequently used features of
different formats, for example, due to the utilized logging customers. Flexible log data allows using it in various use
frameworks and programming languages [15]. Several cases with different perspectives. However, as different
aspects or parameters have an influence on the log format. persons are working with log data, there can be conflicts
In the following, five commonly used parameters are between their requirements toward the log data because of
introduced as an example: Identifiers, Log Levels, for instance different interests and aims underlying to their
Messages, Timestamps, and Unique Code Types. use cases.

A parameter that is used are identifiers. For example, with Analysis


process identifiers, messages or events can be related to tasks Beside to that, another challenge is that current software
or other events [11]. Depending on the log format, identifiers systems become larger and larger with more complex
may be specified differently. structures [11]. Thereby big amounts of logs are produced by
these systems, which makes manual log analysis almost not
Log levels are generally utilized to assign different severities feasible [18]. In addition, log data are also generated in fast
to individual log events. This can later be helpful to filter rates and efficient analysis methods are needed [12].
among other things log data. By using different log levels as
parameter, this subdivision of the log data can be performed Appearance
and log information can be stored in different categories Another challenge is that log data contain intertwined
[16]. An „error“ log level can be used, for example, to mark dependencies as well as correlations between log events,
log events which are added to the log data due to a failure in which make it non-trivial to preprocess these data for
the underlying system. Ideally, further information is analyses [9]. Additionally, log events can repeat over time,
included in order to be able to analyze the error situation for example, as parts of software programs are executed in
precisely and that errors can be detected and corrected based loops [12].
on respective log events. Log files can also be used to
generate statistics during normal operation of the Procedure
application. For this purpose, entries with a log level like Another challenge are the steps in the procedure and
“info” can be utilized, for example, to get information about questions that have to be clarified by inserting log events in
successfully completed processes. Using the “debug” log software systems. Chen and Jiang [19] named them “where-
level, for example, more detailed information can be written to-log”, “what-to-log” and “how-to-log”. The challenge
down to enable debugging [16]. It is helpful to activate this “where-to-log”, is about determining the suitable logging
log level only during debugging and preferably only for the locations to collect findings about system runtime behavior.
part of the system that is analyzed. “What-to-log” is used to highlight the challenge to provide
enough information in the logging events. Thereby it is to be
Another parameter are messages in textual forms [12]. These considered among other things, which parameters, for
messages are different depending on the information and example, identifier or message are relevant within the
context they provide within a log event and look like normal protocol format and which information is helpful in each
text. As the texts in the messages vary a lot, automated individual parameter, for example, what is written inside a
analysis of these messages can be difficult for software message. The “how-to-log” challenge is about developing
systems. and maintaining good value logging code. Gholamian and
Ward [15] added beside these three questions “whether-to-
Often log events have timestamps as a parameter at the
log” as a fourth.
beginning [12]. However, these time stamps can also be
challenging because sometimes they do not represent the
actual time of the generation of log events. This can be Taxonomy for Log Data
caused, for example, by technological restrictions like delays
through buffering or time synchronization. A taxonomy is a classification scheme for objects that helps
understanding and analyzing complex issues in a certain
It is also possible to assign a unique code to each log event.
domain [20]. It can provide a baseline for grouping objects
This can make it easier to trace where exactly the log event
into a field by common characteristics.Nickerson, Varshney
came from [16].
et al. [20] analyze taxonomies of information systems. They
Setup classify the approaches of the taxonomies into the following
The different setups in which log data can emerge is a further three categories: (i) inductive, (ii) deductive, and (iii)
challenge. Depending on which logging framework, system intuitive. The inductive approach involves looking at
or programming language is selected and used, log data have examples or experiences that are then analyzed to determine
different setups. Thereby it is possible that log data are stored the dimensions and characteristics of the taxonomy. In the
in a structured form, for example, with a list of comma- deductive approach, a taxonomy is extracted from theory or
separated values, or in a semi-structured form, for instance conceptualization. In this approach, the dimensions and
with attribute-value pairs [16]. Alternatively, log data can be features in the taxonomy are identified through a logical
unstructured, for example, with only free text of arbitrary process based on a solid conceptual or theoretical grounding.
length or combinations thereof. The intuitive approach is essentially spontaneous. The
researcher uses his/her understanding of the objects to be
Operation classified to suggest a taxonomy based on the researcher's
In addition, log data are used from different persons who perceptions.
work on various tasks [17]. Tasks can be, for example,
In Figure 1, a generated taxonomy for log data is presented. regarding log data in the literature. These challenges can be
The taxonomy is derived with an inductive approach by used for deploying criteria, which allows for the
identifying the above discussed nine challenges within classification of logging aspects.
Section “Challenges Around Logging and Log Data”

Figure 1. Taxonomy for log data based on the 5V of Big Data and the challenges for logging and log data.

The first level below the log data level in Figure 1 is based
on the 5Vs that are used in the definition of Big Data [21]. Automotive High Performance
Value, Variety, Velocity, Veracity and Volume. As log data Computers and Logging
are generated in large amounts in several software systems,
these data can be considered as Big Data [22]. Frameworks
This layer with the 5V represents meta characteristics which In general, writing log data are relatively simple and can be
are used as a basis for the selection of further criteria in the done with various technologies [16]. For most programming
taxonomy. Each broader criterion is a logical consequence of languages, there is a wide number of libraries that support
a meta characteristic. In addition to the 5V meta handling log files. These libraries can be used to include the
characteristics, there is also the classification object “Other”, logging framework. Nevertheless, as seen in Figure 1,
which has criteria that cannot be classified under the 5Vs. classifying log data is not trivial since different criteria can
On the second level in Figure 1 are the criteria, which can be be applied.
applied to classify log data objects. In addition to the criteria To apply the taxonomy to an example, logging frameworks
derived from the challenges from Section “Challenges of the three software platforms Android, AUTOSAR
Around Logging and Log Data", there are also the criteria Adaptive and Java and their resulting log data are described.
“Ownership” and “Data Occurrence”, which are derived However, the three platforms are first placed in the context
from Zrenner, Hassan et al. [23]. Additionally, there is a of the vehicle and automotive HPCs. This is described in the
criterion “Approach” which is deduced from the survey by first Section “Integration of Automotive High Performance
Chen and Jiang [24] with the examples conventional Computers (HPCs) Into the Vehicle Architecture”.
approach, rule-based approach and distributed tracing. Afterwards the logging frameworks are explained in more
Under the rule-based approach belongs, for example, the detail in Section “Logging Frameworks” and are then
aspect-oriented programming-based approach. In addition, compared with each other using the criteria from the
there are criteria “Origin”, “Output”, and “Benefit”. The taxonomy.
third, lowest level in Figure 1 comprises further criteria or
examples for the respective criteria. A branch with examples Integration of Automotive High
is indicated by an aspect with three points leaving further
points open. Performance Computers (HPCs) Into the
Vehicle Architecture
As seen in Figure 1, the taxonomy has three levels or The current Electric/Electronic (E/E) architecture of vehicles
dimensions downwards from the term log data and most consists of more than 100 decentralized Electronic Control
often three examples on the third level. This means that this Units (ECUs) [25]. Due to more and more software functions
taxonomy contains a limited number of dimensions and in the vehicle, this architecture with ECUs is approaching its
features in each dimension as named as an important aspect limitations. For that purpose, the current trend in the
described by Nickerson, Varshney et al [29]. An extensive automotive area is towards systems on which functions are
classification scheme with multiple dimensions and features centralized and less decentralized ECUs are used. The
would be difficult to understand and apply. The taxonomy architecture is initially divided into domains and in the
contains also enough dimensions and features to clearly longer term further subdivided into zonal clusters. For these
distinguish the objects of interest and allow for the inclusion systems, larger ECUs with more computing power and
of additional dimensions and features [20]. subcomponents are used, compared to normal ECUs [26].
These larger ECUs are often called automotive High is utilized by the AUTOSAR Adaptive platform. By the Java
Performance Computers (HPC). platform, the two logging frameworks” log4j” in version 2
and “java.util.logging” are applied, as they are identified in
A simplified automotive HPC architecture is presented in literature as commonly used frameworks.
Figure 2, following [27] and [28]. As seen in Figure 2, an
automotive HPC consists of several layers such as multi-core
processor system, hypervisors, operating systems, software
frameworks and applications. For example, Android,
AUTOSAR Adaptive and Java apps can be integrated into
an automotive HPC, like in Figure 2. On the left side in
Figure 2 is the AUTOSAR Adaptive app stack. In the middle
of Figure 2 is a stack where a Java app can be executed and
on the right is the Android app stack. From these applications
on automotive HPCs, log data can be generated by applying
logging frameworks, which perform logging.

Figure 2. Simplified automotive HPC architecture with three


kinds of apps.
Figure 3. Overview of the four logging frameworks
The paper focuses on these types of apps, because of the fact investigated in this paper.
that Android apps represent a large market segment and can
be delivered to vehicle customers via their integration into Android Logging Framework
automotive HPCs as in-car apps. In addition, the focus is on In the Android environment, an app developer inserts
AUTOSAR Adaptive apps because the context of activations for log events at selected points in the program
automotive HPCs is the automotive area and AUTOSAR is code, which can be called to generate messages at critical
typically used within the vehicle. Java apps are included points in the app's program code [13]. Furthermore, there are
because some in-car apps could also be written in Java. In also logs that are returned automatically by the Android
addition, Java is also used in vehicle diagnostics, for system. The logging system in Android is built-on a set of
example, in the Open Diagnostics Data Exchange (ODX) structured circular buffers [32]. This means that when the
field in vehicles [29]. The ODX format is specified in the storage space in a ring buffer is used up, old data are
ISO 22901 standard [30]. It is an Extensible Markup removed while new data are added. The available buffers are
Language (XML)-based format for the description of ECU fixed and defined by the system. Five relevant ring buffers
diagnostic data [29]. This data exchange format can be used, are: main, system, crash, event and radio, which represent
for example, to describe diagnostic services, flash data or the five types of logs available in the Android environment.
diagnostic jobs. An ODX diagnostic job contains a single The log events of the ring buffer main, system and crash are
process that communicates with ECUs several times and is output by default. The events of the radio and events ring
implemented in the Java programming language. Besides, buffers have to be requested explicitly.
Java is a programming language which is among the top 4
In the logging system of Android, all log events can be read
languages in the TIOBE index of October 2022 and is widely
out with the Logcat command-line tool or the Logcat
used [31].
window in the Android Studio environment [32, 33]. The
Logging Frameworks Logcat command-line has also the option to write log event
In the following sections, the four logging frameworks based outputs to a file. The logs include events from the Android
on the three platforms Android, AUTOSAR Adaptive, and system as well as log events that the developer has set up for
Java are introduced, as a basis for their comparison. This its own Android app. In addition, the stack trace can be read
helps to understand how logging is performed under the out [34]. A stack trace is generated whenever an app crashes
mentioned frameworks. Figure 3 gives an overview of the because of an error or an exception and contains information
introduced logging frameworks hereafter classified related about the cause of an error or an exception. When using the
to the underlying platform. The three points in Figure 3 Logcat command-line tool or the Logcat window, the
indicate respective examples of other logging frameworks Android Debug Bridge (ADB) is also required [32, 33].
that are not covered in this paper. The term software However, the ADB is first used for control, since it is
framework refers in this paper to the runtime environment of responsible for communication between the development
a software platform, which allows running apps on operating system on a computer, like the Android SDK, and the
systems. connected Android devices.

From the Android platform, the common logging framework To generate own log data, for example, as an App developer,
is used, which is based on the “android.util.Log” package. the Android SDK offers an own log class within the util
The AUTOSAR Adaptive Log and Trace logging framework package named "android.util.Log" [35]. This class contains
different methods to write various log events. The messages
can be viewed through the Logcat window in the Android In a system, such as an ECU or the entire vehicle, each
SDK or through the Command line tool. Generally, one of application process has a specific application ID and
six methods of the Log class is used [33]. These methods are description to differentiate the logs of the various
associated with a respective log level. In general, there are applications in the system [38]. To distinguish the logs from
the following six log levels, written in descending order of various logical groups within an application process, each
importance: Assert, Error, Warning, Info, Debug, and context in the application process has a specific context ID
Verbose. Verbose logs are used during the development of and description. The log mode indicates the destination
the app and are the default setting, while debug logs are where the passed log information can be stored, like the
compiled in but removed at runtime. Error, warning and info communication bus in a network, console or file system. If
logs are kept each time. the log mode is adjusted to a file, the log file path is required
to know the destination directory path. Log messages that
Each of the log methods takes usually two parameters of type are logged before the logging framework can process them
String [36]. The first parameter is assigned to the tag of the are placed in a queue. The size of the queue is predefined. If
message, which informs about the origin of the message and this size is exceeded, the oldest entries are deleted.
can be used to identify it later. The second parameter
contains the output text. This means the actual content of the There are two types of classes for log messages [39]. Non-
message. Sometimes there is a third parameter named modeled messages add all arguments of an event inside an
Throwable that can also be defined. internal event buffer and serialize them for output. In the
DLT protocol, these messages are also called "verbose"
Basically, each log event with one or more lines of code messages. These messages are mainly used during
consists of different metadata fields beside the tag and the development or if enough memory and high network
log level [37]. Log level is sometimes named as priority. By bandwidths are given. Modeled messages are designed to
control the log output format, the format of a log event can reduce traffic on the network by omitting certain static parts
differ, depending on which metadata fields are displayed. In of a message from the network. These parts are instead added
default mode, also named as threadtime, the first data fields to the ARXML model of the application. In the DLT
are the date and the invocation time. Afterwards each log has protocol, these messages are also known as "non-verbose"
a log level and a tag. In addition, it has also a Process ID messages. An application for displaying protocol messages
(PID) and a thread Identifier (TID). PID and TID can be the can display the complete messages by combining the static
same if there is only one thread. At the end, the log events parts of the model with the dynamic parts of the received
have a text message. A list of other supported formats of the messages.
Logcat command-line tool are presented in [37].
The log level, named by AUTOSAR Adaptive severity level,
The above introduced logging framework is commonly used provides meta information about the log level of a passed
in Android and also the one described in the Android logging information and can act like a filter [38]. This means
documentation [29, 33]. Other logging frameworks may also if a certain log level is addressed, only log events, which
work in the Android ecosystem. However, these are not have a higher or same log level, are processed while the
addressed within this paper. others are ignored. In general, there are the following six log
levels, written in descending order of importance: Fatal,
AUTOSAR Adaptive Logging Framework
Error, Warning, Info, Debug, and Verbose.
On the AUTOSAR (Automotive open system architecture)
Adaptive Platform, AUTOSAR Adaptive Logging offers an The event or message format of the DLT protocol has a
interface for applications to send logging information to a Standard Header, an optional Extended Header and a
communication bus, console, or file system [38]. In order to Payload segment [39]. The content of these three parts are
provide logging information within AUTOSAR in a described hereafter. For further details inside each part, it is
standardized transport and presentation format, a protocol is referred to [39]. The Standard Header contains the following
required. This is why the AUTOSAR consortium has three to six fields in the mentioned order:
standardized the Log and Trace (LT) protocol. In this paper,
the documentation for the specification of log and trace from • Header type, (Byte 0)
release 2021 [38] is used as well as the documentation for • Message Counter (Byte 1)
the log and trace protocol specification from release 2020 • Length (Byte 2-3)
[39]. • ECU ID, which is optional (Byte 4-7)
• Session ID, which is optional (Byte 8-11)
The Diagnostics Log and Trace (DLT) protocol is a GENIVI • Timestamp, which is optional (Byte 12-15)
Log and Trace daemon implementation of the LT protocol,
which is used in the Adaptive Logging by the backend and The Extended Header consists of the following four fields:
by the Logging client [38]. The AUTOSAR Adaptive user
applications can submit their logging information to the Log • Message Info (Byte 0)
and Trace backend via logging APIs, which are written in the • Number of Arguments (Byte 1)
C++ programming language and integrated in a Software • Application ID (Byte 2-5)
System (SWS). The logging information can be applied by a • Context ID (Byte 6-9)
Logging client, which can filter or sort the received
information. Besides, the Communication Management API, The Payload segment differs depending if the verbose mode
ara::com, can also address the Logging APIs. In the or the non-verbose mode is used for log events [39]. The
AUTOSAR environment, log events are often named as log payload of messages, which are sent in verbose mode for
messages. non-modelled messages, contains also a complete
description of the parameters besides the parameter values
themselves. This means that on the one hand, no external file
is required for additional logging information. However, on destinations, such as memory. Both Loggers and Handlers
the other hand, a higher volume of data is transmitted on the can use logging levels and (optionally) filters to decide
bus. Verbose mode can be applied on ECUs that have enough whether they are interested in a particular LogRecord. A
memory and a high network bandwidth. Due to the self- Formatter can be used to locate and format a message before
description, the stored data on the external client can be it is published to some other location. Some Handlers can
interpreted at any time and without further external pass outputs to other Handlers.
information. In the payload, the individual arguments are
composed of a Type Info field followed by a Data Payload Within the Logger class there are different methods to
field. Non-Verbose Mode for modelled messages can be produce log events [47]. These methods are associated with
used with the payload to transmit parameter values without different standard logging levels defined in the Level class.
the need for meta-information about them or additional The levels can be used to control the logging output, since
properties to the parameters. A special message ID is activating a certain level also activates logging on all higher
attached to the payload that refers to a separate, external file levels. In general, there are the following seven log levels,
or an ARXML system description in which the description written in descending order of importance: Severe, Warning,
of the payload layout is given. After the Message ID, non- Info, Config, Fine, Finer and, Finest. Furthermore, it is
static Data is provided, for example, with parameters. generally possible for third parties to define additional
logging levels through subclasses of levels.
Java Logging Frameworks
Within Java, there is a built-in logging framework in the In total, there are two standard Formatter [46]
java.util.logging package [40]. However, there are also implementations in this logging framework. The
several other external frameworks that can be used in Java. SimpleFormatter can be used to write short human-readable
summaries of log entries. Thereby the following seven
Chen and Jiang [14] conduct an empirical study to arguments are possible [48]:
investigate the usage of various Java logging frameworks, as
some software systems such as Android applications, web 1. Format: in which the format string or the default format
services or Big Data platforms are implemented in Java and is specified
logging is widely used there. Chen and Jiang name logging 2. Date: Represents the date and time of the log event
frameworks within the study as Logging Utilities (LU). In 3. Source: The string representing the caller or the name
the top ten most popular LUs, according to Chen and Jiang's of the logger
research, there are the following six LUs for logging 4. Logger: Name of the loggers
purposes in software systems of desktop applications or 5. Level: Log level
server-based systems: 6. Message: Formatted log message
7. Thrown: String representing the throwable associated
• Apache Commons Logging with the log entry and its traceback
• Java.util.logging The first argument can be used to customize the format,
• LogBack allowing it to change depending on the individual Java
• Log4j 1.x, version 1.x project. The second formatter is the XML-Formatter, which
• Log4j 2, version 2 can be used to write detailed and standardized XML-
• SLF4J structured logs [46]. However, with a subclass, formatting in
XML can be overridden and the message field can be
SLF4J is the most popular LU due to its improved
reformatted. In addition, additional formatters can be
performance and compatibility with other LUs [14]. SLF4J
developed.
and Apache Commons Logging are logging APIs, but they
delegate the writing of logs by logging frameworks such as In general, it can be seen from the mentioned Java logging
Log4j or Java.util.logging [41]. frameworks, like log4j, LogBack and java.util.logging, that
there are similar methods for the generation of logs.
Log4j 2 is the enhancement of Log4j 1.x. The logging
However, the format of the logs can be chosen very flexibly,
framework Log4j has six methods to generate logs with
because it is possible to use different layouts with various
corresponding log levels [42]. In general, there are the
parameters.
following six log levels, written in descending order of
importance: Fatal, Error, Warn, Info, Debug, and Verbose. In
Log4j, an appender is used to format a log event into a Evaluation
desired layout [43]. There are different layouts possible, for
example, CSV, HTML, JSON, RFC5424, or XML with After presenting the logging frameworks, selected criteria of
various meta fields inside each layout. The logging the taxonomy about log data are used to evaluate four
framework logBack also offers different formats [44]. logging frameworks of the three software platform
frameworks: Android, AUTOSAR Adaptive and Java. For
The package java.util.logging.Logger, from the Java logging
Java, the two well-known frameworks java.util.logging and
framework java.util.logging, procures various classes and
log4j 2 are evaluated in the following. The selected criteria
interfaces as logging utilities for the programming language
are key characteristics to distinguish the logging
Java [45]. With the included logging APIs, logs can be
frameworks. Table 2 shows the evaluation in form of a
written [46]. The Logger object is the main entity so that
comparison. The aspect Further Characteristics in Table 2
applications can execute logging calls. These Logger objects
provides additional information, which is not covered by the
assign LogRecord objects, which are used to pass logging
other criteria. Later, the results presented in Table 2 are
calls between the logging framework and individual log
discussed in more detail.
Handlers. The Handlers export LogRecord objects to various
Table 2. Evaluation of the four logging frameworks: Android.uitl.Log, AUTOSAR Adaptive Log and Trace, java.uil.logging and
log4j 2.

Logging Frameworks
Android Platform AUTOSAR Adaptive Platform Java Platform
Android.util.Log AUTOSAR Adaptive Log and java.util.logging log4j 2
Trace
Format Identifier Process-ID (PID) ECU ID, Session ID, Application Depends on the established format
Thread-ID (TID), ID, Context ID, or all
or both

Log Assert, Error, Fatal, Error, Warning, Info, Severe, Warning, Info, Fatal, Error, Warn, Info,
level Warning, Info, Debug, Verbose Config, Fine, Finer, Debug, Trace
Debug, Verbose Finest
Tag Yes Over the Application ID and/or For example, over the With a Parameter
Context ID Source with the
SimpleFormatter
Text Yes Yes (non-modeled or modeled Yes
messages)
Time- Yes Yes Yes
stamps
Other Default format: standardized Log and Trace (LT) Formatter can be used, Appender can be used to
Criteria / Classification aspects

format threadtime protocol (→Diagnostics Log and like SimpleFormatter format logs in a desired
aspects Trace (DLT) protocol) or XMLFormatter, or layout, e.g. CSV,
individual formats can HTML, XML or
be created individual formats can
be created
Appearance Correlations, Dependencies, Repetition, or further
Generation Developers, Software system side, or further
Operation (major) Failure analysis Developed for vehicle Different areas
diagnostics
Origin Apps in-car Apps in-car Apps, Cloud Systems, or On Premise
Systems
Ownership Public Private Public
Setup Semi-structured Semi-structured Depends on format
Storage Console: Logcat Console, File, or Communication Console, File, or Cloud
Command-line or Bus System
Logcat window, or
File
Further • Circular ring • internal event buffer or • Define additional log levels through
Characteristics buffer queue subclasses of levels
• Stack trace • Log level equates to • Programming languages (natively): Java
• Programming Severity level
languages • API programming
(natively): (natively): C++
Java, Kotlin

Format Furthermore, it can be seen that logs from Android and


From Table 2 follows that the two Java frameworks, AUTOSAR Adaptive have predefined components in the
java.util.logging and log4j 2, have several similarities across formats. Logs in Java, on the other hand, are very flexible in
the individual criteria. In the aspect of format, their default their generation or format. For that reason, it might be useful
options differ. With java.util.logging two formatters can be to focus on logs from AUTOSAR Adaptive and Android.
used to define the log data format or individual formats can This is because in the direction of Java logs it is easier to
be set up. With log4j 2, the definition of the format goes over give indications of how logs there need to look in order to be
the desired layout and its integrated format components, or able to evaluate those using methods from automotive HPC
an own format can be provided. Also, the log levels and how diagnostics for future vehicle diagnostics.
tags are defined are different. AUTOSAR Adaptive specifies In addition, the number and meaning of the log levels in
the format of the log data with its standardized LT protocol. Android and AUTOSAR Adaptive are comparable. Both
However, it leaves some freedom in the configuration, since have six log levels and only the top log level has a different
some inner format components can be optionally used. naming. The log levels of log4j in Java would also be
Android specifies a default format that is initially used if no comparable to Android and AUTOSAR Adaptive, but in
adjustments are applied by the developer. Besides the default java.util.logging, for example, there are a different number
format, there are a few other formats where less content is of log levels with different meanings. This makes it difficult
visible. at first to include Java logs in further considerations of
AUTOSAR Adaptive and Android logs. As a result, there is
no uniform log level description in the Java framework, line. AUTOSAR Adaptive log data can also be written to the
which initially complicates the inclusion of Java logs in communication bus and transported further in the vehicle. In
further considerations of AUTOSAR Adaptive and Android the case of Java log data, the data can also be stored directly
logs. in the cloud.

This means, that there are differences among the three Further Characteristics
considered frameworks, Android, AUTOSAR Adaptive and In the Android framework, there is the concept of circular
Java, in the respective log data formats. The logs, which are ring buffers to keep the log data temporarily. The stack trace
generated in vehicles with the already established is used in Android whenever an app crashes due to an error
AUTOSAR Adaptive framework have different format or exception and contains information about the causes of
components than the logs of Android apps. If Android and the error or exception. It is helpful to use the verbose log
AUTOSAR Adaptive logs are now evaluated together with a level only during app development and debug logs are
method, the question arises how the log formats are handled. removed at app runtime. Typically, Android apps are
programmed with the Java or Kotlin programming
Appearance and Generation languages.
Within the log data, as shown in Table 2, there are
correlations, dependencies and repetitions among others The AUTOSAR Adaptive framework supports internal event
regarding the three logging frameworks. In addition, the log buffers or queues for caching the logs. The log levels are
data for the three frameworks are set up by developers or by known as severity levels in AUTOSAR Adaptive. The
the software system side. programming language of the logging API for AUTOSAR
Adaptive is C++. In Java frameworks, additional log levels
If log data are generated by developers and by the software can be created by creating subclasses of levels. The
system side, it needs to be further explored whether the programming language for Java apps is traditionally Java.
generated log data are sufficient to perform efficient analyses
and whether failures in the vehicle can be found out of them.
Conclusion and Outlook
Operation (major) and Origin
The log data in Android are primarily used for failure The aspects summarized in Table 2 and the taxonomy
analysis as seen in Table 2. AUTOSAR Adaptive log data are presented in Figure 1 show that data logging is a complex
utilized for vehicle diagnostics but currently only in manual topic. There are different challenges to handle like, for
analysis by developers. Log data from the Java environment example, the varied parameters in the format or the storage
can be applied in various areas. Android and AUTOSAR of the log data. In addition, no uniform logging approach
Adaptive log data are typically found in apps, whereas Java exists. This makes it difficult to perform further analyses
log data can occur not only in apps, they can also occur in with the log data and to generate statements from log data.
cloud systems or on premise systems.
In this paper, challenges of log data are identified and hereon
Ownership a taxonomy for log data is derived. Some benefits of
AUTOSAR Adaptive log data are owned by the respective applying the taxonomy are, for example, to get a better
automotive company and is not publicly available, since it understanding of certain log data by classifying them or to
refers, for example, to vehicle functionalities that may be help by drawing conclusions from specific log data. In
relevant for competition as presented in Table 2. Log data addition, it also helps to compare and evaluate various types
from Android and Java are mostly freely accessible, since of log data and select the most suitable one for a particular
both frameworks are publicly usable for developers. application.

Since AUTOSAR Adaptive log data are only accessible As an example, this taxonomy is applied in this paper to four
within automotive companies, automotive HPC diagnostics logging frameworks commonly used within the three
and the resulting future vehicle diagnostics are initially software platforms Android, AUTOSAR Adaptive and Java.
determined by the internal steps in vehicles. In order to This makes it possible to evaluate the four frameworks, with
inform external customers outside the vehicle about the criteria based on the taxonomy, and to identify similarities
failures and diagnostic results, it is necessary to consider and differences.
how the results from the log data are communicated and In comparison of Android and AUTOSAR, for example, the
transported to them. default log data formats have some similar standard
parameters like identifiers, log levels, tag, text, and time
Setup stamps. Even the number of log levels is the same. In turn,
Android and AUTOSAR Adaptive log data consist of a semi- log data from Java logging frameworks has a variety, as
structured setup based on their components in the format if different log data formats can be established for specific
the defined formats are applied in the frameworks as seen in cases. The log level number can vary, depending on the
Table 2. They are made up of structured, predefined text chosen Java logging frameworks.
fields and dynamic, free text fields. Log data in Java can
have a different structure depending on the format. A similarity of log data in Android, AUTOSAR Adaptive and
Java is, for example, that they have all characteristics of
Storage correlations, dependencies, or repetition. These make log
In Table 2, it is shown that all three frameworks can store log data diagnostics quite challenging as these characteristics are
data in files or provide them via the console. For Android, sometimes not easy identified. Furthermore, the concepts of
the console is the Logcat window or the Logcat command- log data in Android and AUTOSAR are developed for a
specific environment. For Android, it is major the 8. S. Bickelhaupt et al., “Challenges and Opportunities of
application area for mobile devices and there apps. For Future Vehicle Diagnostics in Software-Defined
AUTOSAR it is the automotive area and apps on AUTOSAR Vehicles,” SAE Technical Paper, 2023-01-0847, 2023.
ECUs. Whereas, logs of the Java platform are used within 9. M. Landauer, S. Onder, F. Skopik, and M.
various areas and systems. Wurzenberger, “Deep Learning for Anomaly Detection
in Log Data: A Survey,” Jul. 2022. [Online]. Available:
During the development of the taxonomy and there usage as https://arxiv.org/pdf/2207.03820
part of the evaluation, some topics for future work in the 10. A. Avizienis, J.-C. Laprie, B. Randell, and C.
field of automotive HPC diagnostic have emerged. The Landwehr, “Basic Concepts and Taxonomy of
following are a few examples. Dependable and Secure Computing,” IEEE
Trans.Dependable and Secure Comput., vol. 1, no. 1,
A first future work direction could be to identify methods,
pp. 11–33, 2004, doi: 10.1109/TDSC.2004.2.
which can analyze log data efficiently in the vehicle
11. S. He et al., “A Survey on Automated Log Analysis for
ecosystem. This would be significant, for example, to keep
Reliability Engineering,” ACM Comput. Surv., vol. 54,
in-car apps functional and to be able to detect failures in in-
no. 6, pp. 1–37, 2021, doi: 10.1145/3460345.
car apps, especially software failures, at an early stage. In
12. M. Landauer, F. Skopik, M. Wurzenberger, and A.
this context, it makes sense to consider how a suitable,
Rauber, “System log clustering approaches for cyber
uniform log format might be structured. This could be
security applications: A survey,” Computers & Security,
advantageous because working with different log data
vol. 92, p. 101739, 2020, doi:
formats, such as from Android, AUTOSAR and Java, for
10.1016/j.cose.2020.101739.
example, can complicate the analysis of log data if the
13. J. Staudemeyer, Android mit Kotlin: Kurz & gut, 1st ed.
methods cannot rely on a uniform format. It could be useful
[Deutschland], Heidelberg: O'Reilly; dpunkt.verlag,
to focus first on data from Android and AUTOSAR Adaptive
2018.
apps, as these two can form the main app environment in the
14. B. Chen and Z. M. Jiang, “Studying the use of Java
vehicle. Afterwards, the findings can be applied to other
logging utilities in the wild,” in Proceedings of the
apps, such as ones built with Java.
ACM/IEEE 42nd International Conference on Software
Since logging technology has its origins in the IT domain, a Engineering, Seoul South Korea, 2020, pp. 397–408.
second future work direction could be to evaluate further its 15. S. Gholamian and P. A. S. Ward, “A Comprehensive
suitability for the automotive ecosystem. For that reason, in Survey of Logging in Software: From Logging
the future, the taxonomy as well as the results from Table 2 Statements Automation to Log Mining and Analysis,”
and other criteria could be used to assess the usage of logging ArXiv, abs/2110.12489, 2021.
technology in the automotive environment and the vehicle in 16. E. Wolff, Continuous Delivery: Der pragmatische
particular. Einstieg, 2nd ed. Heidelberg: dpunkt.verlag, 2016.
17. T. Barik, R. DeLine, S. Drucker, and D. Fisher, “The
bones of the system,” in Proceedings of the 38th
References International Conference on Software Engineering
Companion, Austin Texas, 2016, pp. 92–101.
1. X. Boucherat, “Power in your pocket: what's the future 18. Q. Wang, X. Zhang, X. Wang, and Z. Cao, “Log
of the car smartphone apps?,” Automotive World Sequence Anomaly Detection Method Based on
Magazine, April 2021, no. 16, pp. 44–47, 2021. Contrastive Adversarial Training and Dual Feature
2. U. Winkelhake, “Challenges in the Digital Extraction,” Entropy, vol. 24, no. 1, p. 69, 2021, doi:
Transformation of the Automotive Industry,” ATZ 10.3390/e24010069.
Worldwide, 7-8, no. 121, pp. 36–42, 2019. 19. B. Chen and Z. M. Jiang, “Characterizing and Detecting
3. M. Pese, K. Shin, J. Bruner, and A. Chu, “Security Anti-Patterns in the Logging Code,” in 2017
Analysis of Android Automotive,” in SAE Technical IEEE/ACM 39th International Conference on Software
Paper Series, 2020. Engineering (ICSE), Buenos Aires, 2017, pp. 71–81.
4. B. Eriksson, J. Groth, and A. Sabelfeld, “On the Road 20. R. Nickerson, U. Varshney, and J. Muntermann, “A
with Third-party Apps: Security Analysis of an In- method for taxonomy development and its application
vehicle App Platform,” in Proceedings of the 5th in information systems,” European Journal of
International Conference on Vehicle Technology and Information Systems, vol. 22, pp. 336–359, 2013.
Intelligent Transport Systems, Heraklion, Crete, 21. R. K. Lomotey and R. Deters, “Towards Knowledge
Greece, 2019, pp. 64–75. Discovery in Big Data,” in 2014 IEEE 8th International
5. M. Steffelbauer, “SOVD - The Diagnostic Standard of Symposium on Service Oriented System Engineering,
Tomorrow,” ATZ Electron Worldw, vol. 16, no. 4, pp. Oxford, United Kingdom, 2014, pp. 181–191.
44–48, 2021, doi: 10.1007/s38314-021-0591-1. 22. Graylog, How Big Data and Log Management work
6. P. Subke, M. Moshref, and J. Erber, “In-Vehicle hand in hand. https://www.graylog.org/post/how-big-
Diagnostic System for Prognostics and OTA Updates of data-and-log-management-work-hand-in-hand/
Automated/Autonomous Vehicles,” SAE Int. J. Adv. & (accessed: Oct. 28 2022).
Curr. Prac. in Mobility, vol. 2, no. 5, pp. 2963–2968, 23. J. Zrenner, A. P. Hassan, B. Otto, and J. C. Marx
2020, doi: 10.4271/2020-01-1373. Gómez, “Data source taxonomy for supply network
7. M. Davidekova and M. Gregu Ml, “Software structure visibility,” 2017.
Application Logging: Aspects to Consider by 24. B. Chen and Z. M. Jiang, “A Survey of Software Log
Implementing Knowledge Management,” in 2016 2nd Instrumentation,” ACM Comput. Surv., vol. 54, no. 4,
International Conference on Open and Big Data (OBD), pp. 1–34, 2022, doi: 10.1145/3448976.
Vienna, 2016, pp. 102–107.
25. V. Bandur, G. Selim, V. Pantelic, and M. Lawford, 42. Apache Software Foundation, Custom Log Levels.
“Making the Case for Centralized Automotive E/E https://logging.apache.org/log4j/2.x/manual/customlog
Architectures,” IEEE Trans. Veh. Technol., vol. 70, no. levels.html (accessed: Nov. 3 2022).
2, pp. 1230–1245, 2021, doi: 43. Apache Software Foundation, Layouts.
10.1109/TVT.2021.3054934. https://logging.apache.org/log4j/2.x/manual/layouts.ht
26. Sebastian Ohl, “Simplifying Automotive High- ml (accessed: Nov. 3 2022).
Performance Computer Development by Using a Pre- 44. C. Gülcü et al., Chapter 6: Layouts.
integrated Software Platform,” in GMM-Fachbericht, https://logback.qos.ch/manual/layouts.html (accessed:
vol. 99, Automotive meets Electronics: Beiträge des 12. Nov. 3 2022).
GMM-Symposium, March, 10 – 11, 2021, Online- 45. Oracle Docs, Package java.util.logging.
Veranstaltung, 1st ed., Berlin: VDE VERLAG, 2021, https://docs.oracle.com/javase/7/docs/api/java/util/log
pp. 34–38. ging/package-summary.html (accessed: Oct. 26 2022).
27. Continental AG, Body High-Performance Computer: 46. Oracle Docs, Java™ Logging Overview.
More Intelligence with Server-based E/E Architectures. https://docs.oracle.com/javase/7/docs/technotes/guides
https://www.continental-automotive.com/en- /logging/overview.html (accessed: Oct. 26 2022).
gl/Passenger-Cars/Architecture-and- 47. Oracle Docs, Class Level.
Networking/Body-High-Performance-Computer https://docs.oracle.com/javase/8/docs/api/java/util/log
(accessed: May 24 2022). ging/Level.html (accessed: Oct. 26 2022).
28. Dr. Boris Böhlen, Dr. Oliver Meyer, Dr. Simon Becker, 48. Oracle Docs, Class SimpleFormatter.
Dr. Roland Stoffel, Mario Alberto Ortegón-Cabrera, https://docs.oracle.com/javase/7/docs/api/java/util/log
“Diagnose von HPCs über SOVD,” in Diagnose in ging/SimpleFormatter.html (accessed: Oct. 26 2022).
mechatronischen Fahrzeugsystemen XV: Predictive
Maintenance, Remote Diagnose, KI / Maschinelles
Lernen, Standardisierung, HU und ePTI, Dresden,
Contact Information
2022, pp. 113–128.
29. M. Steffelbauer and B. Rösch, “ODX simplifies Sandra Bickelhaupt, M. Sc.
diagnostic process chain,” AutoTechnol, vol. 6, no. 2,
e-mail: sandra.bickelhaupt@mercedes-benz.com
pp. 56–59, 2006, doi: 10.1007/BF03246947.
30. ISO 22901-1:2008: Road vehicles - Open diagnostic
data exchange (ODX) - Part 1: Data model Acknowledgments
specification, International Organization for
Standardization (ISO). This publication is based on the research project SofDCar
https://www.iso.org/standard/41207.html (19S21002), which is funded by the German Federal
31. TIOBE, TIOBE Index for October 2022. Ministry for Economic Affairs and Climate Action.
https://www.tiobe.com/tiobe-index/ (accessed: Oct. 28
2022).
32. Android Developers, Logcat command-line tool.
https://developer.android.com/studio/command-
line/logcat (accessed: Oct. 12 2022).
33. Android Developers, Write and View Logs with Logcat.
https://developer.android.com/studio/debug/am-logcat
(accessed: Oct. 11 2022).
34. Android Developers, Analyze a stack trace.
https://developer.android.com/studio/debug/stacktrace
s (accessed: Oct. 24 2022).
35. A.-R. Mawlood-Yunis, Android for Java Programmers,
1st ed. Cham: Springer International Publishing;
Imprint: Springer, 2022.
36. Android Developers, Log.
https://developer.android.com/reference/android/util/L
og (accessed: Oct. 24 2022).
37. Android Developers, Logcat command-line tool.
https://developer.android.com/studio/command-
line/logcat#Overview (accessed: Oct. 11 2022).
38. AUTOSAR, “Specification of Log and Trace: Adaptive
Platform,” no. 853, 2021.
39. AUTOSAR, “Log and Trace Protocol Specification:
Foundation,” no. 787, 2020.
40. B. Baesens, A. Backiel, and S. Vanden Broucke,
Beginning Java programming: The object-oriented
approach. Indianapolis, Ind.: Wrox/Wiley, 2015.
41. U. Post, Besser coden, 1st ed. Bonn: Rheinwerk Verlag,
2018.

View publication stats

You might also like