Skip to content

Hive client logger breaks JSON based logging #6621

@holzerch

Description

@holzerch

Hello Hive team,

we configured the Hive client to use our own JSON based logger (pino). The idea of a JSON based logger is that all the data of a single log entry is part of a single JSON entry. We noticed now that your internal HiveLogger breaks this logic by splitting up all lines of a stack trace into different log lines/entries

return {
    [hiveSymbol]: context,
    info: (message: string) => {
      logger.info(`${path} ${message}`);
    },
    error: (error: any, ...data: any[]) => {
      if (error.stack) {
        for (const stack of error.stack.split('\n')) {
          logger.error(`${path} ${stack}`);
        }
      } else {
        logger.error(`${path} ${String(error)}`, ...data);
      }
    },
  };

See:

for (const stack of error.stack.split('\n')) {

I don't know why you are doing this, but it is very bad, because the log information is now split up and very hard to read.

Could you please remove this logic at least when a custom logger is configured?

Thanks
Christian

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions