Comments (26)
From my understanding elastic search is doing its own configuration with a yaml file but actually uses log4j.
What you need is a dependency on raven-log4j
, and use a configuration similar to what is described in the INSTALL.md file:
https://github.com/kencochrane/raven-java/blob/master/INSTALL.md#using-log4j
from sentry-java.
By the way you should use maven to manage your dependencies rather than downloading the snapshot manually
from sentry-java.
I installed elasticsearch as a deb file. I do not know how to use mvn with a deb file to be honest.
I have managed to add the jars and I think I have it working now.
The type in my post above was wrong. It should have been what it was in the docs: net.kencochrane.raven.log4j.SentryAppender
I have it up and it appears to be running -- when I run the app manually I get:
May 16, 2013 12:11:42 PM net.kencochrane.raven.DefaultRavenFactory createConnection
INFO: Using an HTTP connection to Sentry.
For anyone interested my conf was:
sentry:
type: net.kencochrane.raven.log4j.SentryAppender
dsn: "http://XXXX:[email protected]/9"
from sentry-java.
Great, unless there is something else I'll close this issue.
from sentry-java.
I have set my logging level to debug:
rootLogger: DEBUG, console, file, sentry
but I am not getting an event when the following occurs:
[2013-05-16 12:16:02,106][DEBUG][action.bulk ] [Jack of Hearts] [haystack][3] failed to execute bulk item (index) index {[haystack][modelresult][mymodel.10], source[SOME INVALID JSON]}
org.elasticsearch.index.mapper.MapperParsingException: failed to parse [expertise_risk_types_id]
at org.elasticsearch.index.mapper.core.AbstractFieldMapper.parse(AbstractFieldMapper.java:396)
at org.elasticsearch.index.mapper.object.ObjectMapper.serializeObject(ObjectMapper.java:515)
at org.elasticsearch.index.mapper.object.ObjectMapper.parse(ObjectMapper.java:457)
at org.elasticsearch.index.mapper.DocumentMapper.parse(DocumentMapper.java:506)
at org.elasticsearch.index.mapper.DocumentMapper.parse(DocumentMapper.java:450)
at org.elasticsearch.index.shard.service.InternalIndexShard.prepareIndex(InternalIndexShard.java:326)
at org.elasticsearch.action.bulk.TransportShardBulkAction.shardOperationOnPrimary(TransportShardBulkAction.java:157)
at org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction$AsyncShardOperationAction.performOnPrimary(TransportShardReplicationOperationAction.java:532)
at org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction$AsyncShardOperationAction$1.run(TransportShardReplicationOperationAction.java:430)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:722)
Caused by: org.elasticsearch.ElasticSearchIllegalArgumentException: unknown property [id]
at org.elasticsearch.index.mapper.core.StringFieldMapper.parseCreateField(StringFieldMapper.java:281)
at org.elasticsearch.index.mapper.core.AbstractFieldMapper.parse(AbstractFieldMapper.java:385)
... 11 more
Should I receive an event from this? I thought so.
from sentry-java.
Maybe closed a little early ;)
I still do not have events in sentry.
from sentry-java.
That's odd, may I see your entire configuration for logging?
The fact that you have a message from raven ("using HTTP...") tells me that the logger is set up properly, so I suspect that there is something else wrong in the configuration.
from sentry-java.
Here it is:
https://gist.github.com/eamonnfaherty/1024d06061ab942138a0
from sentry-java.
I have checked the nginx logs and there hasn't been any sign of incoming requests.
from sentry-java.
Okay, I'm really confused now. Do you have any other logs? Something that could come from raven?
from sentry-java.
I have grep'd the logs for raven and sentry. I cannot find anything.
Could it be that the debug being raised within elasticsearch is not being escalated to the logger. Do you know of a way I can test the loger sends on an error?
from sentry-java.
Did you mean do I have other sentry events? If so, yes I do.
from sentry-java.
Other events in sentry sent by elastic-search?
from sentry-java.
I have not seen any others. That's what I was asking. How can I send a test event using the library?
I tried disrupting my elasticsearch but nothing has sent an event yet but I am not sure if it should.
from sentry-java.
Hum, I think I know what I overlooked. Did you add the dependencies of raven to the lib folder?
Raven depends on commons-codec-1.8 and jackson-core-2.2.0
from sentry-java.
FWIW, I've tried it without the dependencies. It seems that elasticsearch hides the error that happens when a class isn't found (dependency missing), making it a bit complicated to diagnose.
I've also noticed other issues with the log4j appender which entered in a feedback loop while testing against elastic search. I've fixed that and a new SNAPSHOT of raven-4.x is available.
And now you will need to also add slf4j-api-1.7.5 as a dependency of raven.
from sentry-java.
I have updated to the latest version and I am now getting this:
May 16, 2013 8:39:43 PM net.kencochrane.raven.connection.HttpConnection doSend
SEVERE: Client/server version mismatch: Unsupported protocol version (4)
java.io.IOException: Server returned HTTP response code: 400 for URL: http://myserver.com/api/9/store/
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1625)
at net.kencochrane.raven.connection.HttpConnection.doSend(HttpConnection.java:105)
at net.kencochrane.raven.connection.AbstractConnection.send(AbstractConnection.java:78)
at net.kencochrane.raven.connection.AsyncConnection$EventSubmitter.run(AsyncConnection.java:139)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:722)
from sentry-java.
That's better. This means that you are using raven-4.x when your sentry instance uses another protocol (probably v3).
In that case you need to download raven-3.x (it is up to date)
from sentry-java.
I am using Sentry 5.4.5. Surely that should be protocol 4?
from sentry-java.
No, protocol 4 isn't available in a stable release yet.
from sentry-java.
ahh thanks.
I have switched to version 3 and now when elasticsearch starts it does not output that it is using sentry/raven and the logging still doesn't work.
elasticsearch just halts in the terminal when it runs. The logs show it (elasticsearch) has started but the logging does not work and the terminal doesn't show that sentry is being connected to.
Are the dependencies still the same?
from sentry-java.
I am using
raven-3.0-20130516.191912-9.jar
raven-log4j-3.0-20130516.191940-9.jar
and the deps:
jackson-core-2.2.2-20130512.040915-3.jar
commons-codec-1.8.jar
from sentry-java.
as for raven-4.x:
- slf4j-api 1.7.5
- commons-codec 1.8
- jackson-core 2.2.0
If you want to get the logs from raven you should also throw slf4j-log4j12 1.7.5 in it.
from sentry-java.
ha ha ha! Be careful what you wish for! I have about 1k events in my sentry instance!
Thank you for all your help. When I did not have slf4j-api 1.7.5 the logging did not work. Once I added it everything worked!
Thank you very much again!
from sentry-java.
That being said, I'm not sure what is your use case, but most of the time sentry is nice to catch errors and follow the trends, but if you want to store the logs and be able to search through them, there are other (and more appropriate) solutions such as logstash/kibana.
from sentry-java.
I want to report on an error occurring within my django site. It is when data is sent to elasticsearch that is invalid.
Within elasticsearch it is recorded as debug as it does not affect the running of elasticsearch. Unfortunatly the library receiving the response does not process the error back from the api in the way that I would have hoped. I am logging the event now with sentry as it is listening to elasticsearch thanks to your help. I will have a look through this other library now to see how can I contribute these changes.
Thanks again!!
from sentry-java.
Related Issues (20)
- Reducing writes performed by the PersistingScopeObserver HOT 5
- Add `tunnel` option (sets the url used by transport) HOT 1
- SentryTaskDecorator cleanup HOT 2
- Report app start type via app context HOT 1
- Find a replacement for p6spy HOT 1
- Support span level measurements HOT 1
- Significant memory usage HOT 12
- Attach frame delay to spans
- [Java] Add support for Sentry Metrics HOT 3
- Resolve spring expressions in @SentryCheckIn HOT 5
- Add Split Apks information as tag HOT 1
- Custom transaction not getting recorded when screen navigates HOT 8
- Support Spring's new RestClient with auto configuration HOT 4
- [Spring Boot Log4j] Unable to output sdk debug logging to log4j2 file. HOT 6
- Can not exclude SentryWebfluxAutoConfiguration on Spring Boot 3.* HOT 1
- Kotlin Compiler Plugin does not tag @Composable functions HOT 2
- SentryNanotimeDate.nanoTimestamp does not provide nanosecond precision HOT 3
- Implement new envelope items: Replay, ReplayRecording, ReplayVideo
- Sentry Invalidating Transactions for unfinished Spans HOT 3
- Issue with the p6spy's PreparedStatementWrapper HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sentry-java.