Skip to content

Demonstrates use of the Perfect Logging system

License

Apache-2.0, Unknown licenses found

Licenses found

Apache-2.0
LICENSE
Unknown
LICENSE.zh_CN
Notifications You must be signed in to change notification settings

PerfectExamples/Perfect-Logging

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Perfect Logging Example

Get Involed with Perfect!

Star Perfect On Github Stack Overflow Follow Perfect on Twitter Join the Perfect Slack

Swift 3.0 Platforms OS X | Linux License Apache PerfectlySoft Twitter Slack Status

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.

Compatibility with Swift

The master branch of this project currently compiles with Xcode 8.1 or the Swift 3.0.1 toolchain on Ubuntu.

Building & Running

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.

Xcode

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.

Issues

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

Further Information

For more information on the Perfect project, please visit perfect.org.

About

Demonstrates use of the Perfect Logging system

Topics

Resources

License

Apache-2.0, Unknown licenses found

Licenses found

Apache-2.0
LICENSE
Unknown
LICENSE.zh_CN

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages