Perfect Logging Demonstration
This project is a simple demonstration of running an HTTP server with a custom logging function. This is not HTTP Request logging, this is application level logging.
See the documentation for more detailed description of the Perfect Logging functionality.
The master branch of this project currently compiles with Xcode 8.1 or the Swift 3.0.1 toolchain on Ubuntu.
The following will clone and build an empty starter project and launch the server on port 8181.
git clone https://github.com/PerfectExamples/Perfect-Logging.git
cd Perfect-Logging
swift build
.build/debug/Perfect-Logging
You should see the following output:
[INFO] Server Setup message
[INFO] Server port is: 8181
[DBG] Demonstrating a logging event without the linked event id
[INFO] Starting server
[INFO] Starting HTTP server on 0.0.0.0:8181
[DBG] This is a request log event fired when route hit by a browser.
The last line is generated when visiting http://localhost:8181 in a browser.
When viewing the generated log file (customLogFile.log) you will see more detail, including the event id's:
[INFO] [d9fd0367-0d38-4975-82d3-94ffd86b1fb3] [2016-12-21 13:35:21 GMT-05:00] Server Setup message
[INFO] [d9fd0367-0d38-4975-82d3-94ffd86b1fb3] [2016-12-21 13:35:21 GMT-05:00] Server port is: 8181
[DEBUG] [c622ab31-3f0f-4339-b1e6-ef985f35e6e5] [2016-12-21 13:35:21 GMT-05:00] Demonstrating a logging event without the linked event id
[INFO] [d9fd0367-0d38-4975-82d3-94ffd86b1fb3] [2016-12-21 13:35:21 GMT-05:00] Starting server
[DEBUG] [6b7a5601-ff89-4e54-8a17-c99743784e06] [2016-12-21 13:35:36 GMT-05:00] This is a request log event fired when route hit by a browser.
To run the project in Xcode, navigate to the directory in terminal and execute:
swift package generate-xcodeproj
Then open the generated project, select the executable scheme, edit the scheme and change the current working directory to the project's directory (so you can see the generated log file more easily). Then Run the project.
We are transitioning to using JIRA for all bugs and support related issues, therefore the GitHub issues has been disabled.
If you find a mistake, bug, or any other helpful suggestion you'd like to make on the docs please head over to http://jira.perfect.org:8080/servicedesk/customer/portal/1 and raise it.
A comprehensive list of open issues can be found at http://jira.perfect.org:8080/projects/ISS/issues
For more information on the Perfect project, please visit perfect.org.