googleapis / googleapis/google-cloud-java

[java-logging-logback] Full stack in case of an exception not logged

オープン
#12,015 コメント 2 件 リアクション 7 件 担当者 1 名 @cindy-peng が担当を希望しています GitHub で見る
api: logging priority: p3 type: feature request
主要言語
Java
スター
2.1k
フォーク
1.2k
平均マージ
1日 23時間
マージ済み PR(30日)
154

説明

Thanks for stopping by to let us know something could be better!

**PLEASE READ**: If you have a support contract with Google, please create an issue in the [support console](https://cloud.google.com/support/) instead of filing on GitHub. This will ensure a timely response.

Please run down the following list and make sure you've tried the usual "quick fixes":

- Search the issues already opened: https://github.com/googleapis/java-logging-logback/issues
- Check for answers on StackOverflow: http://stackoverflow.com/questions/tagged/google-cloud-platform

If you are still having issues, please include as much information as possible:

#### Environment details

1. Specify the API at the beginning of the title. For example, "BigQuery: ...").
General
2. OS type and version: All
3. Java version: 17
4. version(s): 0.123.8-alpha

#### Steps to reproduce

1. Log any exception - `log.error("a message", e);
2. The message showing up in the console or in stack driver has only the top level message from the stack trace. The remaining stack is lost. The approach taken by logback's console appender is to print the remain stack in a different field called "exception" this way keeping it separate from the main message which also works.

#### Code example

```java
// example
```

#### Stack trace
```
logger.error("some exception message", e);
```

```
{"severity":"ERROR","timestamp":"2022-04-30T03:18:00.315Z","logging.googleapis.com/labels":{"levelName":"ERROR","loggerName":"org.springframework.boot.autoconfigure.web.reactive.error.AbstractErrorWebExceptionHandler","levelValue":"40000"},"logging.googleapis.com/trace_sampled":false,"@type":"type.googleapis.com/google.devtools.clouderrorreporting.v1beta1.ReportedErrorEvent","message":"[d1dbed05-3] 500 Server Error for HTTP GET \"/greetings/exception\"\njava.lang.RuntimeException: Throwing an explicit exception\n at SomeClass.greetingsWithException(GreetingsController.kt:27)"}
```

#### External references such as API reference guides

#### Any additional information below

Following these steps guarantees the quickest resolution possible.

Thanks!

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。