{"id":23338269,"url":"https://github.com/abhirockzz/fn-syslog-example","last_synced_at":"2025-04-07T13:43:37.907Z","repository":{"id":79125020,"uuid":"144583626","full_name":"abhirockzz/fn-syslog-example","owner":"abhirockzz","description":"Exporting Fn function logs to remote syslog service","archived":false,"fork":false,"pushed_at":"2019-04-11T03:27:00.000Z","size":715,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-02-13T16:25:22.411Z","etag":null,"topics":["faas","fnproject","functions","orafunc-la","serverless","workshop"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/abhirockzz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-08-13T13:28:50.000Z","updated_at":"2019-04-11T03:27:02.000Z","dependencies_parsed_at":null,"dependency_job_id":"fb6e705d-7665-44c7-ad95-061edc10f149","html_url":"https://github.com/abhirockzz/fn-syslog-example","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abhirockzz%2Ffn-syslog-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abhirockzz%2Ffn-syslog-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abhirockzz%2Ffn-syslog-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abhirockzz%2Ffn-syslog-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/abhirockzz","download_url":"https://codeload.github.com/abhirockzz/fn-syslog-example/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247665949,"owners_count":20975783,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["faas","fnproject","functions","orafunc-la","serverless","workshop"],"created_at":"2024-12-21T03:13:26.313Z","updated_at":"2025-04-07T13:43:37.885Z","avatar_url":"https://github.com/abhirockzz.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Exporting function logs to remote syslog service\r\n\r\nFn allows you to push the [function logs to a syslog endpoint](https://github.com/fnproject/docs/blob/master/fn/operate/logging.md#remote-syslog-for-functions). This is an example of how to configure it and test it our using [Papertrail](https://papertrailapp.com)\r\n\r\n## step 0 \r\n\r\n### create a Papertrail account\r\n\r\nPapertrail is a hosted log management service. You can sign up for a [free account](https://papertrailapp.com/signup?plan=free) for the purposes of this tutorial\r\n\r\n### create log destination\r\n\r\nGo to Settings (top right hand corner) and click on Log Destinations. Create a log destination.\r\n\r\n### make a note of your *destination*\r\n\r\nOn the Papertrail [**Settings**](https://papertrailapp.com/account) choose **Log Destinations** (from the options in the left) and copy the endpoint - you'll use this in subsequent steps\r\n\r\n![](settings.jpg)\r\n\r\n### For TCP, unselect TLS and select Plain Text\r\n\r\nAs shown below ... Settings \u003e Log Destination \u003e my.papertrail.com:4242 \u003e Settings\r\n\r\nFor TCP \u003e Unselect TLS and Select Plain Text\r\n\r\n![](unselect-TLS.png)\r\n\r\n## Create application\r\n\r\n- Get the latest version of Fn CLI - `curl -LSs https://raw.githubusercontent.com/fnproject/cli/master/install | sh`\r\n- Create an application with `syslog` endpoint info - `fn create app fn-syslog-app --annotation oracle.com/oci/subnetIds=\u003cSUBNETS\u003e --syslog-url tcp://\u003cyour papertrail syslog endpoint\u003e` e.g. `fn create app fn-syslog-app --syslog-url tcp://my.papertrail.com:4242`\r\n- Switch to the context for Oracle Functions - `fn use context \u003ccontext-name\u003e`\r\n\r\n### If you already have an existing application...\r\n\r\n.. you can just configure that to use the papertrail `syslog` endpoint as well. \r\n\r\n**Using the Fn CLI**\r\n\r\nIt is as simple as\r\n\r\n`fn update app \u003capp-name\u003e --syslog-url tcp://\u003cyour papertrail syslog endpoint\u003e` e.g.`fn update app my-existing-app --syslog-url tcp://my.papertrail.com:4242`\r\n\r\n**Using the Oracle Functions console**\r\n\r\nOpen your application from the `Applications` page and click `Edit Application`\r\n\r\n![](console-1.png)\r\n\r\nEnter the `syslog` endpoint and click `Save`\r\n\r\n![](console-2.png)\r\n\r\nYou should now see the updated value\r\n\r\n![](console-3.png)\r\n\r\n\r\n## Deploy\r\n\r\n- Clone or download this repo\r\n- `cd fn-syslog-example`\r\n- `fn -v deploy --app fn-syslog-app`\r\n\r\nYour function should now be deployed. Check it\r\n\r\n`fn inspect app fn-syslog-app`\r\n\r\nYou will see something similar to this - notice the `syslog_url` configuration\r\n\r\n\t{\r\n                .....\r\n\t        \"created_at\": \"2018-08-13T11:39:48.943Z\",\r\n\t        \"id\": \"01CMSHBGTFNG8G00GZJ0000001\",\r\n\t        \"name\": \"fn-syslog-app\",\r\n\t        \"syslog_url\": \"tcp://my.papertrailapp.com:4242\",\r\n\t        \"updated_at\": \"2018-08-13T11:39:48.943Z\"\r\n                .....\r\n\t}\r\n\r\n\r\n## Test\r\n\r\nTest using Fn CLI with `fn invoke` command\r\n\r\n### Invoke\r\n\r\n- `fn invoke fn-syslog-app fn-syslog-func`\r\n- `echo -n 'fun with fn!' | fn invoke fn-syslog-app fn-syslog-func` \r\n\r\nYou can repeat this multiple times\r\n\r\n### Check your Papertrail a/c\r\n\r\nHop over to your Papertrail [dashboard](https://papertrailapp.com/dashboard) and click **Events** (top right) to see the logs\r\n\r\n![](events.jpg)\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabhirockzz%2Ffn-syslog-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fabhirockzz%2Ffn-syslog-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabhirockzz%2Ffn-syslog-example/lists"}