Server ACRA for Node.js with data base Mongodb
Save all the crash reports in your own server.
- Statistics by android version.
- Statistics by date error.
- Statistics by mobile.
Server = [node.js, express, ejs, mongodb, emailjs, node-properties-parser, colors, moment, async]
Client = [bootstrap, jquery, tablesorter, jqplot]
- Download and unzip (or git clone) into a directory.
- Run "$ npm install"
- Configure /acra_server.properties with mongodb, port web, user and password access and email credentials.
- Run app via "$ node appAcra"
- Build a Server to replace Google Docs.
- Write using modern tecnologies as Node.js and Mongodb.
- Simple configuration with a only one properties file.
- Interface using Bootstrap.
- Basic front end web pages.
- Send emails when receive ACRA report.
- Login system to protect access.
- Export all reports in json format.
- Export detail report in json format.
- Delete report.
- Multiple applications in the same server.
- Separate the crash in differents collections by app
You need to convert the USER_CRASH_DATE from Text to Date format, the solution is execute a script:
modify_db.js
Edit the script:
var NAME_COLLECTION = "your_collection";
var DB_URL = "mongodb:https://127.0.0.1:27017/your_db";
And Execute
node modify_db.js
-
Config Acra Class in application with the url of the server
-
Configuration URL in Java Class (https://SERVER:PORT_SERVER/logs/NAME_APP)
2.1. SERVER (IP or DNS)
2.2. PORT_SERVER (PORT WEB SERVER)
2.3. NAME_APP (NAME APP where will be save all the crash)
- Example url: https://my_server:port_server/logs/my_app
import org.acra.*;
import org.acra.annotation.*;
@ReportsCrashes(formUri = "https://SERVER:PORT_SERVER/logs/NAME_APP", formKey="")
public class MyApplication extends Application {
@Override
public void onCreate() {
// The following line triggers the initialization of ACRA
ACRA.init(this);
super.onCreate();
}
}
More information about configuration Android application here
# CONFIGURATION WEB
# Acra web server port
port_web = 3000
# Web access user
username = john
# Web acess password
password = john
# Cookie config
key = acraserver
secret = b29a25fe160453b475d4243d12yrty342345752eeaa5bc
# CONFIGURATION MONGODB
# port mongodb
mongodb_port = 27017
# Ip mongodb
mongodb_ip = localhost
# Name Data base
name_database = acraloggerdb
# CONFIGURATION MAIL
# yes or no if want send email if acra error recive
send_mail = yes
# config connection email server
user_mail= [email protected]
password_mail = password_mail_gmail
host =smtp.gmail.com
ssl = true
# config email
subject = Acra Error Server
from = [email protected]
# List emails separate with comma example john@gmail,[email protected]
to = [email protected],[email protected]
#config date
date_format=YYYY-MM-DD hh:mm:ss
Automatic configuration:
- Creation of DB automatic
- Creation collection automatic
- Independent collections by App
- https://my_server:port_server (and login)
##Thank you
Paolo Casarini that made the original implementation:
https://www.casarini.org/blog/2013/acra-nodejs-mongodb/
( The MIT License )
Copyright (c) 2013 Diego Martin Moreno
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.