我是Sentry的新手,紧追this
并遵循相同的步骤和代码,我有一个sbt项目,在其中创建了sentry.properties
文件,其内容为
dsn=https://public:private@host:port/1
并在引发异常后运行代码(与上面的链接相同的代码)时将其放置在src/main/resources
下'
18:19:26.745 [run-main-1] DEBUG io.sentry.config.Lookup - Found dsn=https://public:private@host:port/1 in sentry.properties.
18:19:26.754 [run-main-1] ERROR io.sentry.SentryClientFactory - Error creating valid DSN from: 'https://public:private@host:port/1'.
io.sentry.dsn.InvalidDsnException: Invalid DSN, the following properties aren't set '[host, public key]'
at io.sentry.dsn.Dsn.validate(Dsn.java:209) ~[sentry-1.7.16.jar:na]
at io.sentry.dsn.Dsn.<init>(Dsn.java:66) ~[sentry-1.7.16.jar:na]
at io.sentry.dsn.Dsn.<init>(Dsn.java:41) ~[sentry-1.7.16.jar:na]
at io.sentry.SentryClientFactory.resolveDsn(SentryClientFactory.java:73) [sentry-1.7.16.jar:na]
at io.sentry.SentryClientFactory.sentryClient(SentryClientFactory.java:42) [sentry-1.7.16.jar:na]
at io.sentry.Sentry.init(Sentry.java:81) [sentry-1.7.16.jar:na]
at io.sentry.Sentry.init(Sentry.java:44) [sentry-1.7.16.jar:na]
at sentry.SentryDemo$.main(SentryDemo.scala:16) [classes/:na]
at sentry.SentryDemo.main(SentryDemo.scala) [classes/:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_181]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_181]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_181]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_181]
at sbt.Run.invokeMain(Run.scala:67) [run-0.13.16.jar:0.13.16]
at sbt.Run.run0(Run.scala:61) [run-0.13.16.jar:0.13.16]
at sbt.Run.sbt$Run$$execute$1(Run.scala:51) [run-0.13.16.jar:0.13.16]
at sbt.Run$$anonfun$run$1.apply$mcV$sp(Run.scala:55) [run-0.13.16.jar:0.13.16]
at sbt.Run$$anonfun$run$1.apply(Run.scala:55) [run-0.13.16.jar:0.13.16]
at sbt.Run$$anonfun$run$1.apply(Run.scala:55) [run-0.13.16.jar:0.13.16]
at sbt.Logger$$anon$4.apply(Logger.scala:84) [logging-0.13.16.jar:0.13.16]
at sbt.TrapExit$App.run(TrapExit.scala:248) [run-0.13.16.jar:0.13.16]
at java.lang.Thread.run(Thread.java:748) [na:1.8.0_181]
[error] (run-main-1) io.sentry.dsn.InvalidDsnException: Invalid DSN, the following properties aren't set '[host, public key]'
io.sentry.dsn.InvalidDsnException: Invalid DSN, the following properties aren't set '[host, public key]'
at io.sentry.dsn.Dsn.validate(Dsn.java:209)
at io.sentry.dsn.Dsn.<init>(Dsn.java:66)
at io.sentry.dsn.Dsn.<init>(Dsn.java:41)
at io.sentry.SentryClientFactory.resolveDsn(SentryClientFactory.java:73)
at io.sentry.SentryClientFactory.sentryClient(SentryClientFactory.java:42)
at io.sentry.Sentry.init(Sentry.java:81)
at io.sentry.Sentry.init(Sentry.java:44)
at sentry.SentryDemo$.main(SentryDemo.scala:16)
at sentry.SentryDemo.main(SentryDemo.scala)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
是否需要在属性文件中代替dsn
进行补充?我在不是基于Web的项目的项目中使用哨兵