By default, JSCAPE MFT Server records domain logs in log files. While in most cases, this will do, some organizations prefer to record their logs in a database. In this article, we talk about the pros and cons of file-based and database-based logging and how to record files in a database in JSCAPE MFT Server.
Logging to a File vs Logging to a Database
Unless you really want to record your domain logs to a database, JSCAPE MFT Server's default logging service, which records log data into files, should be enough for most logging needs. First of all, because they're created and stored locally, file-based logging is generally faster, less prone to issues, and far less sophisticated.
In database logging, you still need to configure the target database — which can be a pain if you're not familiar with RDBMSes or relational database management systems — and it's prone to certain issues. For example, if your database is running on a separate machine in your network, there's always that risk that the database might become unreachable. It could be because of a network issue or, for whatever reason, the database server might be down. So, in database logging, there's a lot of factors to consider and parts to manage.
In file-based logging, there's nothing to worry about because JSCAPE MFT Server simply generates the log files. As long as you have enough disk space, there shouldn't be any problem. It's very uncomplicated.
So, why would you want to store logs in a database?
Well, there can also be valid reasons for that. First of all, running searches on or generating reports off of log data, especially if you're familiar with SQL, is much easier if that data is stored in a database. You can still use tools like grep to run searches on log files but SQL queries are arguably just more powerful.This basically means, database logging is better suited for auditing purposes. If your organization requires you to audit your logs, then database logging would be a better option.
Another reason is security. Log files are just stored in plaintext. So, if an attacker somehow gains access to your MFT Server machine, that person would be able to easily acquire whatever data is found in your log files. Some RDBMSes, on the other hand, support encryption, so that can be an additional layer of security.
Of course, if you're confident about the security of the machine that's running your JSCAPE MFT Server instance or if you don't think your log files contain sensitive information that would warrant security provided by a RDBMS, then file-based logging shouldn't be a problem. So, it basically boils down to what you're more comfortable with and what your security appetite or preferences are.
How to configure JSCAPE MFT Server to record log data in a database
As mentioned earlier, if you stick to the file-based logging and its default settings, you no longer have to configure anything. But if you want to do database logging, then there are a couple of things you need to prepare. If you want to do that, follow us as we walk you through the steps of setting up database logging on JSCAPE MFT Server.
Before you configure anything on MFT Server, you need to create a database on your RDBMS first. MFT Server currently supports all leading RDBMSes, including: MySQL, Oracle, MS SQL Server, and PostgreSQL, so pick one that you like and create an empty database there.
Here I have an empty database named 'jscapeconfig' on a MySQL server.
Note that this database is still empty. We still need to create a table that will eventually store all your JSCAPE MFT Server domain log data. To create that table, just go to the 'etc' directory of your JSCAPE MFT Server installation directory. There you'll find a set of *log.sql files. Each *log.sql file contains scripts for creating the required log table in a particular RDBMS. Because I'm using the MySQL RDBMS, I need to copy the script found inside the mysql-log.sql file.
Once you have the script, you need to run that script against the database you just created earlier.
If the SQL script execution completes successfully, you should then see your newly created log table under the database you created earlier.
Now that you have your database and log table ready, you can then proceed to configure JSCAPE MFT Server for database logging. To do that, just navigate into the domain that you wish to perform database logging. Note that database logging configuration is done in the domain level, so if you want to perform database logging on all your domains, you need to set up each individual domain for that. But don't worry. This is the easy part.
Once inside the domain, just do the following:
- Navigate into the Logging module
- Go to the Service tab
- Select database from the drop-down list
- Enter your database's JDBC URL (e.g. jdbc://mysql://localhost/jscapeconfig)
- Enter the username of a valid account on your RDBMS with the right privileges
- Enter that account's corresponding password
- Click the Test Parameters button to make sure you can make a connection to the database
- If the test succeeds, click the Apply button to finalize the process.
You can then run some tests by performing some file transfers, running some triggers, etc., and then see if the log entries you see in the Running tab...
... are actually recorded into the log table of your database.
If they're there, then you've done it. You now know how to configure JSCAPE MFT Server to perform database logging.
Would you like to try the FREE Starter Edition of JSCAPE MFT Server? Download it now
Want to be updated on posts like this? Connect with us...