2023-08-07 13:02:49 INFO: user: 33, action: login, from: [0:0:0:0:0:0:0:1]
2023-08-07 13:09:03 INFO: user: 33, report: events, from: 2023-08-07 00:00, to: 2023-08-07 23:59, devices: [1], groups: []
2023-08-07 13:09:08 INFO: user: 33, report: events, from: 2023-08-07 00:00, to: 2023-08-07 23:59, devices: [1], groups: []
2023-08-07 13:09:14 INFO: user: 33, report: events, from: 2023-08-07 00:00, to: 2023-08-07 23:59, devices: [1], groups: []
2023-08-07 13:09:17 INFO: user: 33, report: combined, from: 2023-08-07 00:00, to: 2023-08-07 23:59, devices: [1], groups: []
current log file as above,
for example; Is it possible to create a log like the one below when a command is sent to the device by the user? at the INFO level.
Example command log;
2023-08-07 13:09:17 INFO: user: 33, command: Engine CUT, devices: [3], groups: []
There should be some logging for commands.
Dear Anton,
There are logs of creating and linking the command to the device, but there is no log of sending the command.
(command sending is successful, sms is sent to the device, there is no error)
2023-08-07 14:30:50 INFO: user: 33, action: login, from: [0:0:0:0:0:0:0:1]
2023-08-07 15:30:17 INFO: user: 33, action: logout, from: [0:0:0:0:0:0:0:1]
2023-08-07 15:30:21 INFO: user: 1, action: login, from: [0:0:0:0:0:0:0:1]
2023-08-07 15:30:49 INFO: user: 1, action: create, object: command, id: 4
2023-08-07 15:30:50 INFO: user: 1, action: link, owner: user, id: 1, property: command, id: 4
2023-08-07 15:30:59 INFO: user: 1, action: create, object: command, id: 5
2023-08-07 15:30:59 INFO: user: 1, action: link, owner: user, id: 1, property: command, id: 5
2023-08-07 15:31:07 INFO: user: 1, action: link, owner: device, id: 1, property: command, id: 4
2023-08-07 15:31:10 INFO: user: 1, action: link, owner: device, id: 1, property: command, id: 5
(sms sent after this process does not appear in the logs)
Are you using the latest version?
yes, latest version 5.8
Are you sure you're not filtering the log?
I can share the whole log file if you want,
I'm testing it on windows, I'll test it on linux soon and report the results.
Log file:
2023-08-07 13:01:58 INFO: Operating system name: Windows 10 version: 10.0 architecture: amd64
2023-08-07 13:01:58 INFO: Java runtime name: OpenJDK 64-Bit Server VM vendor: Eclipse Adoptium version: 17.0.6+10
2023-08-07 13:01:58 INFO: Memory limit heap: 3044mb non-heap: 0mb
2023-08-07 13:01:58 INFO: Character encoding: Cp1254 charset: windows-1254
2023-08-07 13:01:58 INFO: Version: 5.8
2023-08-07 13:01:58 INFO: Starting server...
2023-08-07 13:01:59 INFO: HikariPool-1 - Starting...
2023-08-07 13:02:04 INFO: HikariPool-1 - Added connection conn0: url=jdbc:h2:./data/database user=SA
2023-08-07 13:02:04 INFO: HikariPool-1 - Start completed.
2023-08-07 13:02:06 INFO: Set default schema name to PUBLIC
2023-08-07 13:02:06 INFO: Clearing database change log checksums
2023-08-07 13:02:07 INFO: Successfully acquired change log lock
2023-08-07 13:02:08 INFO: Successfully released change log lock
2023-08-07 13:02:09 INFO: Successfully acquired change log lock
2023-08-07 13:02:17 INFO: Reading from PUBLIC.DATABASECHANGELOG
2023-08-07 13:02:19 INFO: Reading from PUBLIC.DATABASECHANGELOG
2023-08-07 13:02:19 INFO: Reading from PUBLIC.DATABASECHANGELOG
2023-08-07 13:02:19 INFO: UPDATE SUMMARY
2023-08-07 13:02:19 INFO: Run: 0
2023-08-07 13:02:19 INFO: Previously run: 43
2023-08-07 13:02:19 INFO: Filtered out: 0
2023-08-07 13:02:19 INFO: -------------------------------
2023-08-07 13:02:19 INFO: Total change sets: 43
2023-08-07 13:02:19 INFO: Update summary generated
2023-08-07 13:02:19 INFO: Successfully released change log lock
2023-08-07 13:02:19 INFO: Successfully released change log lock
2023-08-07 13:02:19 INFO: Command execution complete
2023-08-07 13:02:28 WARN: Port disabled due to conflict - Address already in use: bind - BindException (...)
2023-08-07 13:02:28 WARN: Port disabled due to conflict - Address already in use: bind - BindException (...)
2023-08-07 13:02:28 INFO: jetty-10.0.15; built: 2023-04-11T17:25:14.480Z; git: 68017dbd00236bb7e187330d7585a059610f661d; jvm 17.0.6+10
2023-08-07 13:02:28 INFO: Started o.t.w.@52a02157{/,null,AVAILABLE}
2023-08-07 13:02:28 INFO: Session workerName=node0
2023-08-07 13:02:31 WARN: JAXBContext implementation could not be found. WADL feature is disabled.
2023-08-07 13:02:34 INFO: Started o.e.j.s.ServletContextHandler@274a868a{/,null,AVAILABLE}
2023-08-07 13:02:34 INFO: Started ServerConnector@1571c47e{HTTP/1.1, (http/1.1)}{0.0.0.0:8082}
2023-08-07 13:02:34 INFO: Started Server@2b1fcd53{STARTING}[10.0.15,sto=0] @44910ms
2023-08-07 13:02:49 INFO: user: 33, action: login, from: [0:0:0:0:0:0:0:1]
2023-08-07 13:09:03 INFO: user: 33, report: events, from: 2023-08-07 00:00, to: 2023-08-07 23:59, devices: [1], groups: []
2023-08-07 13:09:08 INFO: user: 33, report: events, from: 2023-08-07 00:00, to: 2023-08-07 23:59, devices: [1], groups: []
2023-08-07 13:09:14 INFO: user: 33, report: events, from: 2023-08-07 00:00, to: 2023-08-07 23:59, devices: [1], groups: []
2023-08-07 13:09:17 INFO: user: 33, report: combined, from: 2023-08-07 00:00, to: 2023-08-07 23:59, devices: [1], groups: []
2023-08-07 13:09:24 INFO: user: 33, report: summary, from: 2023-08-07 00:00, to: 2023-08-07 23:59, devices: [1], groups: []
2023-08-07 13:09:26 INFO: user: 33, report: events, from: 2023-08-07 00:00, to: 2023-08-07 23:59, devices: [1], groups: []
2023-08-07 14:30:50 INFO: user: 33, action: login, from: [0:0:0:0:0:0:0:1]
2023-08-07 15:30:17 INFO: user: 33, action: logout, from: [0:0:0:0:0:0:0:1]
2023-08-07 15:30:21 INFO: user: 1, action: login, from: [0:0:0:0:0:0:0:1]
2023-08-07 15:30:49 INFO: user: 1, action: create, object: command, id: 4
2023-08-07 15:30:50 INFO: user: 1, action: link, owner: user, id: 1, property: command, id: 4
2023-08-07 15:30:59 INFO: user: 1, action: create, object: command, id: 5
2023-08-07 15:30:59 INFO: user: 1, action: link, owner: user, id: 1, property: command, id: 5
2023-08-07 15:31:07 INFO: user: 1, action: link, owner: device, id: 1, property: command, id: 4
2023-08-07 15:31:10 INFO: user: 1, action: link, owner: device, id: 1, property: command, id: 5
2023-08-07 15:46:01 INFO: user: 1, action: logout, from: [0:0:0:0:0:0:0:1]
Actually looks like we only show it for data commands, not SMS. For SMS we only show a log if there's an error.
I understand. When sms commands are sent, is it sufficient to edit the logaction.java file to log INFO level or is a more specific action required? I have read before that this sms command logging is also important for several users, it can be an important function to prove whether the customer has sent an sms command.
Dear Anton., My Problem SOLVED.
I deleted the following line in the CommandResource.java file,
return result ? Response.ok(entity).build() : Response.accepted(entity).build();
I wrote the following lines where,
if (result) {
LOGGER.info("Command sent successfully: UserId={}, Description={}, DeviceId={}",
getUserId(), entity.getDescription(), entity.getDeviceId());
return Response.ok(entity).build();
} else {
LOGGER.info("Command sending accepted: UserId={}, Description={}, DeviceId={}",
getUserId(), entity.getDescription(), entity.getDeviceId());
return Response.accepted(entity).build();
}
As a result, I was able to get the INFO log I wanted. I hope it helps those who want this feature.
In this way, I was able to get the info record as below in the log file.
2023-08-07 23:22:14 INFO: Command sent successfully: UserId=1, Description=testsmscommand, DeviceId=1
Sorry for the translation, I hope you understand.
After traccar master build, I get an error after replacing traccar-server.jar with the built in traccar-master/target folder. Which version of source code should I use?
Column "CALENDARID" not found; SQL statement: UPDATE tc_devices SET name = ?, calendarId = ?, uniqueId = ?, category = ?, disabled = ?, expirationTime = ?, contact = ?, model = ?, phone = ?, groupId = ?, attributes = ? WHERE id = ? [42122-214] - JdbcSQLSyntaxErrorException (... < QueryBuilder:73 < *:140 < DatabaseStorage:110 < BaseObjectResource:102 < ...) ```
anyway, this problem has been solved, new schema has been added to the built traccar-master "5.9" now i noticed, i updated the schema files on the server, the problem is fixed.
Hello.
I am using the latest version of Traccar.
I noticed that this action is not displayed in the log file when any command is sent to the device.
I am using Traccar SMS gateway
Log level INFO in my Traccar.xml file
Is there a way to log when any user sends SMS command when log level is INFO?
Thanks.