CLogDto

The CLogDto class is used to store the data of a LOG entry.

Constructor

There is only one constructor.

public CLogDto(@NotNull final ELevel aLevel,
               @Nullable final Class<?> aClass,
               @Nullable final String aName);

Getter and setter

The LOG level indicates how important this LOG entry is.

@NotNull
public ELevel getLevel();

The logger ID can consist of any class or text. In case of a class, its full name (including package) is used as ID.

@Nullable
public String getName();
@Nullable
public Class<?> getLoggerClass();
@NotNull
public String getLoggerName();

The message is the text that was given during logging. This text is not yet the final formatted text.

@NotNull
public String getMessage();
public void setMessage(@NotNull final String aMessage);

If the formatted text is already available, it can be fetched here.

@NotNull
public String getFormattedText();
public void setFormattedText(@NotNull final String aFormattedText);

The arguments, which are given during logging, are accessible here.

@Nullable
public Object[] getArguments();
public void setArguments(@Nullable final Object[] aArguments);

The supplier is a lambda that returns a completed LOG text or a set of objects. It is only called when the respective logger is actually called for logging (lazy logging).

@Nullable
public Supplier<?> getSupplier();
public void setSupplier(@Nullable final Supplier<?> aSupplier);

The properties can contain context specific information, which should not be provided individually each time logging takes place. LOG writers can process and display this information.

@Nullable
public Properties getProperties();
public void setProperties(@Nullable final Properties aProperties);

Exceptions can be passed when logging errors. Writer can output these as a stack trace.

@Nullable
public Throwable getThrowable();
public void setThrowable(@Nullable final Throwable aThrowable);

The location in the code where logging occurred can also be part of the LOG entry. The boolean native method returns true if the method containing the execution point is a native method.

@Nullable
public String getFileWhereLogged();
public void setFileWhereLogged(@Nullable final String aFileWhereLogged);
public int getLineWhereLogged();
public void setLineWhereLogged(final int aLineWhereLogged);
@Nullable
public String getClassWhereLogged();
public void setClassWhereLogged(@Nullable final String aClassWhereLogged);
public String getMethodWhereLogged();
public void setMethodWhereLogged(final String aMethodWhereLogged);
public boolean isNativeMethod();
public void setNativeMethod(final boolean aNativeMethod);

The thread information for the location where logging occurred is also included.

@Nullable
public String getThreadName();
public void setThreadName(@Nullable final String aThreadName);
public long getThreadId();
public void setThreadId(final long aThreadId);
public int getThreadPriority();
public void setThreadPriority(final int aThreadPriority);

There is a timestamp at which this LOG was generated.

@NotNull
public LocalDateTime getTimeStamp();
public void setTimeStamp(@NotNull final LocalDateTime aTimeStamp);

nyssr.net - Innovative Distributed System