SourceForge > Log4Delphi
 

Installing Log4Delphi

Extracting The Archive

The following instructions can be used for both binary and source distributions.

There are two archive versions available, a ZIP archive which may be extracted using a program like Winzip and a GNU-Zipped Tarball that can also be extracted using Winzip.

Extract the archive to a location of your choice. A resulting folder named log4delphi-version will contain the contents of the package.

Installing

There are two ways in which you can install and use Log4Delphi. The first is to install the package and the second is to simply include the source code in your application's code base. Both have pros and cons and should be carefully considered before making the decision.

Installing The Package

Installing the Log4Delphi package will make it available to be used in all your projects.

Using a binary distribution (log4delphi-version -bin.archive), the steps are:

  1. Launch Delphi.
  2. Select Component > Install Packages from the main menu.
  3. Click the Add button.
  4. Browse to where you extracted the archive and select the file named log4delphi.bpl, should be in the bin/ directory.
  5. You may need to add the compilation units to your library path. To do so, select Tools > Environment Options from the main menu.
  6. Select the Library Tab and add the folder containing log4delphi.bpl to the library path.
  7. You are ready to go!

Using The Source Code

This option is best for people who wish to add to or extend Log4Delphi or people who are busy developing Log4Delphi or people who wish to include Log4Delphi into their existing project's code base.

Using a source distribution (log4delphi-version -src.archive), the steps are:

  1. Copy all the *.pas files from the log4delphi\src\delphi directory to your project's source directory (include the util) directory.
  2. Launch Delphi and Open your project.
  3. Select Project > Add To Project in the main menu.
  4. In the dialog that opens, select all the Log4Delphi source files *.pas that you added earlier.
  5. Click the Open button.
  6. Now build your project.
  7. You are ready to go!

Building Log4Delphi From Source

The source distribution containsa Makefile that can be used to build Log4Delphi from source. You can use Borland's Make which is installed automatically by Delphi.

Open a command prompt (MS-DOS Prompt) and navigate to the root source directory. Simply issue the command make and Log4Delphi will be built.

The Makefile will fail to complete and will not generate HTML documentation. This is because you need to have Apache Forrest installed and set up before running make. This is not required to build Log4Delphi, but if you wish to generate the HTML docs then you need to have it.