aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/database
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2018-09-15 11:51:29 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2018-09-15 11:51:29 +1200
commitfa26dd5f14a991f327c26517a645c6b4f77c4a73 (patch)
tree26477b69c3aeca4cba7b6947cf6973d762841cda /src/org/traccar/database
parent2fb444df86d56246a8b5cee515eb91490c8dee05 (diff)
downloadtraccar-server-fa26dd5f14a991f327c26517a645c6b4f77c4a73.tar.gz
traccar-server-fa26dd5f14a991f327c26517a645c6b4f77c4a73.tar.bz2
traccar-server-fa26dd5f14a991f327c26517a645c6b4f77c4a73.zip
Provide error messages
Diffstat (limited to 'src/org/traccar/database')
-rw-r--r--src/org/traccar/database/BaseObjectManager.java2
-rw-r--r--src/org/traccar/database/CommandsManager.java2
-rw-r--r--src/org/traccar/database/ConnectionManager.java2
-rw-r--r--src/org/traccar/database/DeviceManager.java4
-rw-r--r--src/org/traccar/database/ExtendedObjectManager.java2
-rw-r--r--src/org/traccar/database/GroupsManager.java2
-rw-r--r--src/org/traccar/database/LdapProvider.java2
-rw-r--r--src/org/traccar/database/MediaManager.java2
-rw-r--r--src/org/traccar/database/NotificationManager.java4
-rw-r--r--src/org/traccar/database/PermissionsManager.java4
-rw-r--r--src/org/traccar/database/QueryBuilder.java18
-rw-r--r--src/org/traccar/database/SimpleObjectManager.java2
-rw-r--r--src/org/traccar/database/StatisticsManager.java2
13 files changed, 24 insertions, 24 deletions
diff --git a/src/org/traccar/database/BaseObjectManager.java b/src/org/traccar/database/BaseObjectManager.java
index 7a17f8934..8bf9ef860 100644
--- a/src/org/traccar/database/BaseObjectManager.java
+++ b/src/org/traccar/database/BaseObjectManager.java
@@ -77,7 +77,7 @@ public class BaseObjectManager<T extends BaseModel> {
}
}
} catch (SQLException error) {
- LOGGER.warn(null, error);
+ LOGGER.warn("Error refreshing items", error);
}
}
}
diff --git a/src/org/traccar/database/CommandsManager.java b/src/org/traccar/database/CommandsManager.java
index daf154dc4..d6fdd66ca 100644
--- a/src/org/traccar/database/CommandsManager.java
+++ b/src/org/traccar/database/CommandsManager.java
@@ -129,7 +129,7 @@ public class CommandsManager extends ExtendedObjectManager<Command> {
try {
result.add(new Typed(field.get(null).toString()));
} catch (IllegalArgumentException | IllegalAccessException error) {
- LOGGER.warn(null, error);
+ LOGGER.warn("Get command types error", error);
}
}
}
diff --git a/src/org/traccar/database/ConnectionManager.java b/src/org/traccar/database/ConnectionManager.java
index 3918bcc5f..3d37af710 100644
--- a/src/org/traccar/database/ConnectionManager.java
+++ b/src/org/traccar/database/ConnectionManager.java
@@ -133,7 +133,7 @@ public class ConnectionManager {
try {
Context.getDeviceManager().updateDeviceStatus(device);
} catch (SQLException error) {
- LOGGER.warn(null, error);
+ LOGGER.warn("Update device status error", error);
}
updateDevice(device);
diff --git a/src/org/traccar/database/DeviceManager.java b/src/org/traccar/database/DeviceManager.java
index be413a108..34b02c0e2 100644
--- a/src/org/traccar/database/DeviceManager.java
+++ b/src/org/traccar/database/DeviceManager.java
@@ -96,7 +96,7 @@ public class DeviceManager extends BaseObjectManager<Device> implements Identity
try {
updateDeviceCache(true);
} catch (SQLException e) {
- LOGGER.warn(null, e);
+ LOGGER.warn("Update device cache error", e);
}
result = super.getAllItems();
}
@@ -231,7 +231,7 @@ public class DeviceManager extends BaseObjectManager<Device> implements Identity
positions.put(position.getDeviceId(), position);
}
} catch (SQLException error) {
- LOGGER.warn(null, error);
+ LOGGER.warn("Load latest positions error", error);
}
}
}
diff --git a/src/org/traccar/database/ExtendedObjectManager.java b/src/org/traccar/database/ExtendedObjectManager.java
index e48a3e802..ceb85b537 100644
--- a/src/org/traccar/database/ExtendedObjectManager.java
+++ b/src/org/traccar/database/ExtendedObjectManager.java
@@ -108,7 +108,7 @@ public abstract class ExtendedObjectManager<T extends BaseModel> extends SimpleO
}
} catch (SQLException | ClassNotFoundException error) {
- LOGGER.warn(null, error);
+ LOGGER.warn("Refresh permissions error", error);
}
}
}
diff --git a/src/org/traccar/database/GroupsManager.java b/src/org/traccar/database/GroupsManager.java
index eca39f972..d8404c614 100644
--- a/src/org/traccar/database/GroupsManager.java
+++ b/src/org/traccar/database/GroupsManager.java
@@ -65,7 +65,7 @@ public class GroupsManager extends BaseObjectManager<Group> implements Managable
try {
updateGroupCache(true);
} catch (SQLException e) {
- LOGGER.warn(null, e);
+ LOGGER.warn("Update group cache error", e);
}
result = super.getAllItems();
}
diff --git a/src/org/traccar/database/LdapProvider.java b/src/org/traccar/database/LdapProvider.java
index 612abe055..b30ab45ed 100644
--- a/src/org/traccar/database/LdapProvider.java
+++ b/src/org/traccar/database/LdapProvider.java
@@ -158,7 +158,7 @@ public class LdapProvider {
user.setLogin(accountName);
user.setName(accountName);
user.setEmail(accountName);
- LOGGER.warn(null, e);
+ LOGGER.warn("User lookup error", e);
}
return user;
}
diff --git a/src/org/traccar/database/MediaManager.java b/src/org/traccar/database/MediaManager.java
index 62459cb5e..edade5766 100644
--- a/src/org/traccar/database/MediaManager.java
+++ b/src/org/traccar/database/MediaManager.java
@@ -63,7 +63,7 @@ public class MediaManager {
fileChannel.force(false);
return name;
} catch (IOException e) {
- LOGGER.warn(null, e);
+ LOGGER.warn("Save media file error", e);
}
}
return null;
diff --git a/src/org/traccar/database/NotificationManager.java b/src/org/traccar/database/NotificationManager.java
index 71a0a82e4..60f7f4e4f 100644
--- a/src/org/traccar/database/NotificationManager.java
+++ b/src/org/traccar/database/NotificationManager.java
@@ -64,7 +64,7 @@ public class NotificationManager extends ExtendedObjectManager<Notification> {
try {
getDataManager().addObject(event);
} catch (SQLException error) {
- LOGGER.warn(null, error);
+ LOGGER.warn("Event save error", error);
}
if (position != null && geocodeOnRequest && Context.getGeocoder() != null && position.getAddress() == null) {
@@ -117,7 +117,7 @@ public class NotificationManager extends ExtendedObjectManager<Notification> {
try {
types.add(new Typed(field.get(null).toString()));
} catch (IllegalArgumentException | IllegalAccessException error) {
- LOGGER.warn(null, error);
+ LOGGER.warn("Get event types error", error);
}
}
}
diff --git a/src/org/traccar/database/PermissionsManager.java b/src/org/traccar/database/PermissionsManager.java
index c9d548fd1..d9ab93557 100644
--- a/src/org/traccar/database/PermissionsManager.java
+++ b/src/org/traccar/database/PermissionsManager.java
@@ -111,7 +111,7 @@ public class PermissionsManager {
try {
server = dataManager.getServer();
} catch (SQLException error) {
- LOGGER.warn(null, error);
+ LOGGER.warn("Refresh server config error", error);
}
}
@@ -146,7 +146,7 @@ public class PermissionsManager {
}
} catch (SQLException | ClassNotFoundException error) {
- LOGGER.warn(null, error);
+ LOGGER.warn("Refresh device permissions error", error);
}
deviceUsers.clear();
diff --git a/src/org/traccar/database/QueryBuilder.java b/src/org/traccar/database/QueryBuilder.java
index 8075223f2..5528b2320 100644
--- a/src/org/traccar/database/QueryBuilder.java
+++ b/src/org/traccar/database/QueryBuilder.java
@@ -292,7 +292,7 @@ public final class QueryBuilder {
}
}
} catch (IllegalAccessException | InvocationTargetException | JsonProcessingException error) {
- LOGGER.warn(null, error);
+ LOGGER.warn("Get property error", error);
}
}
}
@@ -324,7 +324,7 @@ public final class QueryBuilder {
try {
method.invoke(object, resultSet.getBoolean(name));
} catch (IllegalAccessException | InvocationTargetException error) {
- LOGGER.warn(null, error);
+ LOGGER.warn("Set property error", error);
}
}
});
@@ -335,7 +335,7 @@ public final class QueryBuilder {
try {
method.invoke(object, resultSet.getInt(name));
} catch (IllegalAccessException | InvocationTargetException error) {
- LOGGER.warn(null, error);
+ LOGGER.warn("Set property error", error);
}
}
});
@@ -346,7 +346,7 @@ public final class QueryBuilder {
try {
method.invoke(object, resultSet.getLong(name));
} catch (IllegalAccessException | InvocationTargetException error) {
- LOGGER.warn(null, error);
+ LOGGER.warn("Set property error", error);
}
}
});
@@ -357,7 +357,7 @@ public final class QueryBuilder {
try {
method.invoke(object, resultSet.getDouble(name));
} catch (IllegalAccessException | InvocationTargetException error) {
- LOGGER.warn(null, error);
+ LOGGER.warn("Set property error", error);
}
}
});
@@ -368,7 +368,7 @@ public final class QueryBuilder {
try {
method.invoke(object, resultSet.getString(name));
} catch (IllegalAccessException | InvocationTargetException error) {
- LOGGER.warn(null, error);
+ LOGGER.warn("Set property error", error);
}
}
});
@@ -382,7 +382,7 @@ public final class QueryBuilder {
method.invoke(object, new Date(timestamp.getTime()));
}
} catch (IllegalAccessException | InvocationTargetException error) {
- LOGGER.warn(null, error);
+ LOGGER.warn("Set property error", error);
}
}
});
@@ -393,7 +393,7 @@ public final class QueryBuilder {
try {
method.invoke(object, resultSet.getBytes(name));
} catch (IllegalAccessException | InvocationTargetException error) {
- LOGGER.warn(null, error);
+ LOGGER.warn("Set property error", error);
}
}
});
@@ -406,7 +406,7 @@ public final class QueryBuilder {
try {
method.invoke(object, Context.getObjectMapper().readValue(value, parameterType));
} catch (InvocationTargetException | IllegalAccessException | IOException error) {
- LOGGER.warn(null, error);
+ LOGGER.warn("Set property error", error);
}
}
}
diff --git a/src/org/traccar/database/SimpleObjectManager.java b/src/org/traccar/database/SimpleObjectManager.java
index bf790da29..15dda4520 100644
--- a/src/org/traccar/database/SimpleObjectManager.java
+++ b/src/org/traccar/database/SimpleObjectManager.java
@@ -80,7 +80,7 @@ public abstract class SimpleObjectManager<T extends BaseModel> extends BaseObjec
getUserItems(permission.getOwnerId()).add(permission.getPropertyId());
}
} catch (SQLException | ClassNotFoundException error) {
- LOGGER.warn(null, error);
+ LOGGER.warn("Error getting permissions", error);
}
}
}
diff --git a/src/org/traccar/database/StatisticsManager.java b/src/org/traccar/database/StatisticsManager.java
index f6ede0a12..dcf15bb04 100644
--- a/src/org/traccar/database/StatisticsManager.java
+++ b/src/org/traccar/database/StatisticsManager.java
@@ -67,7 +67,7 @@ public class StatisticsManager {
try {
Context.getDataManager().addObject(statistics);
} catch (SQLException e) {
- LOGGER.warn(null, e);
+ LOGGER.warn("Error saving statistics", e);
}
String url = Context.getConfig().getString("server.statistics");