Skip to content

Commit fa8e254

Browse files
1 parent 03818c5 commit fa8e254

File tree

74 files changed

+2103
-1632
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+2103
-1632
lines changed

.cfconfig.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"debuggingEnabled" : true
3+
}

.cfformat.json

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
{
2+
"array.empty_padding": false,
3+
"array.padding": true,
4+
"array.multiline.min_length": 40,
5+
"array.multiline.element_count": 4,
6+
"array.multiline.leading_comma.padding": true,
7+
"array.multiline.leading_comma": false,
8+
"alignment.consecutive.assignments": true,
9+
"alignment.consecutive.properties": true,
10+
"alignment.consecutive.params": true,
11+
"brackets.padding": true,
12+
"comment.asterisks": "align",
13+
"binary_operators.padding": true,
14+
"for_loop_semicolons.padding": true,
15+
"function_call.empty_padding": false,
16+
"function_call.padding": true,
17+
"function_call.multiline.leading_comma.padding": true,
18+
"function_call.casing.builtin": "cfdocs",
19+
"function_call.casing.userdefined": "camel",
20+
"function_call.multiline.element_count": 2,
21+
"function_call.multiline.leading_comma": false,
22+
"function_call.multiline.min_length": 40,
23+
"function_declaration.padding": true,
24+
"function_declaration.empty_padding": false,
25+
"function_declaration.multiline.leading_comma": false,
26+
"function_declaration.multiline.leading_comma.padding": true,
27+
"function_declaration.multiline.element_count": 2,
28+
"function_declaration.multiline.min_length": 40,
29+
"function_declaration.group_to_block_spacing": "spaced",
30+
"function_anonymous.empty_padding": false,
31+
"function_anonymous.group_to_block_spacing": "spaced",
32+
"function_anonymous.multiline.element_count": 2,
33+
"function_anonymous.multiline.leading_comma": false,
34+
"function_anonymous.multiline.leading_comma.padding": true,
35+
"function_anonymous.multiline.min_length": 40,
36+
"function_anonymous.padding": true,
37+
"indent_size": 4,
38+
"keywords.block_to_keyword_spacing": "spaced",
39+
"keywords.group_to_block_spacing": "spaced",
40+
"keywords.padding_inside_group": true,
41+
"keywords.spacing_to_block": "spaced",
42+
"keywords.spacing_to_group": true,
43+
"keywords.empty_group_spacing": false,
44+
"max_columns": 140,
45+
"metadata.multiline.element_count": 3,
46+
"metadata.multiline.min_length": 40,
47+
"method_call.chain.multiline": 3,
48+
"newline": "os",
49+
"property.multiline.element_count": 4,
50+
"property.multiline.min_length": 40,
51+
"parentheses.padding": true,
52+
"strings.quote": "double",
53+
"strings.attributes.quote": "double",
54+
"struct.separator": " : ",
55+
"struct.padding": true,
56+
"struct.empty_padding": false,
57+
"struct.multiline.leading_comma": false,
58+
"struct.multiline.leading_comma.padding": true,
59+
"struct.multiline.element_count": 2,
60+
"struct.multiline.min_length": 40,
61+
"tab_indent": false
62+
}

.gitignore

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,2 @@
1-
.*
2-
!.gitignore
3-
*.iml
4-
/server.json
1+
# Testbox dependency
2+
/testbox

CHANGELOG.md

Lines changed: 40 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,43 @@
1-
History
2-
=======
1+
History and Plan
2+
================
3+
4+
2.1+ Plan
5+
6+
- Making Raygun4CFML a Coldbox module OR building a Coldbox module wrapper using Raygun4CFML as a dependency.
7+
- Add breadcrumbs (#46)
8+
9+
2.0.1 Plan
10+
11+
- Add support for response.statusCode (#48)
12+
- Integration and adaptation to Coldbox error reporting, adding CB HMVC app/API samples
13+
- Cleanup `legacy` directory
14+
15+
2.0.0 (Jan 12 2025)
16+
17+
- Fixed issue with Boxlang CGI-Scope
18+
- Added Lucee 5.3 support back-in and provided test server setup
19+
20+
2.0.0-alpha (January 4 2025)
21+
22+
- Complete re-write, breaking API changes and changes in essential functionality:
23+
- Raygun4CFML is now entirely written in CFML script.
24+
- The original stack trace is now tracked in the stack trace field, not the CFML `TagContext`. The latter is now in the exception's data section, where available.
25+
- There is now proper support for nested exceptions (based on existence of `cause` field).
26+
- Content filtering (`RaygunContentFilter`), user identifier (`RaygunIdentifierMessage`) and user custom data (`RaygunUserCustomData`) are now using the builder-pattern approach to be setup for `RaygunClient`.
27+
- Size of raw data can be configured (#42).
28+
- SQL exception tracking has been improved (#44).
29+
- Constants are now tracked in their own static component and some can be overwritten by `RaygunSettings`.
30+
- `ProductCheck` and `RaygunInternalTools` are now static components.
31+
- CFML engine is being track in Raygun's Environment tab now.
32+
- Samples in `/samples` have been reworked.
33+
- Unit/Integration tests are in `/tests/specs`.
34+
- Code formatting via `run-script format` was added for Commandbox.
35+
- Project contains custom CFML server declarations for testing on ports (port 9191 upwards).
36+
- All files have improved code documentation.
37+
- Engine-specific changes:
38+
- Support for Adobe ColdFusion *before* ACF 2021 has been stopped. ACF 2018 and earlier are - as CFML engines go - not supported any more, please upgrade your platforms.
39+
- Support for any versions of Railo has been stopped. Lucee support is set to Lucee 5.4 and newer, but this might be extended to 5.3 in a future 2.0.0 pre-release.
40+
- Support for Boxlang 1.0.0 has been added.
341

442
1.7.0 (November 14 2024)
543

LICENSE renamed to LICENSE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright 2013-2022 Kai Koenig, Ventego Creative Ltd
1+
Copyright 2013-2025 Kai Koenig, Ventego Creative Ltd
22

33
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
44

README.md

Lines changed: 60 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -1,116 +1,105 @@
1-
raygun4cfml
1+
Raygun4CFML
22
===========
33

4-
Raygun Crash Reporting client for CFML.
4+
Raygun4CFML is a client library for integrating Raygun's Crash Reporting service with your CFML applications. It enables you to send error reports and crash data to Raygun for tracking and analysis.
55

6-
Supported:
6+
Supported Platforms:
77

8-
Adobe CF 2018+
9-
Lucee 5+
8+
- Adobe ColdFusion 2021+
9+
- Lucee 5.3+
10+
- Boxlang 1+
1011

11-
Current Version: 1.7.0 (November 14 2024)
12+
Current Version: 2.0.0
1213

13-
Dependencies:
14+
## Active development
1415

15-
- Testbox (for running unit and BDD tests only)
16+
2.0.0 is a complete rewrite of the project and is ready-to-use for the 3 major CFML engines and their crash reports.
1617

17-
## Library organisation
18+
Please be aware that no testing and work has *yet* gone into framework-specific crash reports, e.g. a deeper integration with Coldbox HVMC, Fusebox, CF on Wheels etc. This will be added over time in future releases.
1819

19-
`/src` contains the source code. The package structure is `nz.co.ventego-creative.co.nz.raygun4cfml` but the library's components themselves are independent of the package path. Therefore you can use the library in multiple ways:
20+
## Dependencies
2021

21-
- Put the content of `/src` into your webroot and instantiate `RaygunClient` through something like the following:
22+
- Testbox (used as a development dependency for local and CI testing)
2223

23-
```
24-
raygun = createObject("component","nz.co.ventego-creative.raygun4cfml.RaygunClient").init(
25-
apiKey = "YOURAPIKEYHERE"
26-
);
27-
```
28-
- Put the contents of `/src` into any other place of your choice and create a mapping to `/nz` in your server administrator or through code and then use the instantiation code as above.
24+
## Installation and Setup
2925

30-
- Put the contents of the `raygun4cfml` directory into a place of your choice where your CFML has some sort of a mapping pointing towards and and just instantiate `RaygunClient` like this:
31-
32-
```
33-
raygun = createObject("component","RaygunClient").init(
34-
apiKey = "YOURAPIKEYHERE"
35-
);
36-
```
37-
38-
`/samples` contains a set of files that show how the library can be used in your code through a global error handler as well as a contributed example for ColdBox 3.6
26+
### Using CommandBox (Preferred Method)
3927

40-
`/tests` contains manual tests and more samples as well as a structure (but no tests at this stage) for Testbox unit and BDD tests.
28+
1. **Install via CommandBox:**
4129

42-
## Getting and Using raygun4cfml
30+
To install the latest version from the master repository, use:
31+
```
32+
box install raygun4cfml
33+
```
4334

44-
### Option 1 (preferred):
35+
To install a specific release or tag, use:
36+
```
37+
box install git://github.com/MindscapeHQ/raygun4cfml.git#{tagname}
38+
```
4539

46-
Use Commandbox and Forgebox to get the library and then follow the ideas outlined in 'Library organisation' for further setup.
40+
Alternatively, you can use:
41+
```
42+
box install MindscapeHQ/raygun4cfml#{tagname}
43+
```
4744

48-
To get the latest from the master repository
45+
2. **Setup:**
4946

50-
```
51-
box install raygun4cfml
52-
```
47+
After installation, follow the setup instructions in the 'Library Usage' section below.
5348

54-
To install a specific release or tag:
49+
### Manual Installation
5550

56-
```
57-
box install git://github.com/MindscapeHQ/raygun4cfml.git#{tagname}
58-
```
51+
1. **Clone or Download:**
5952

60-
Example tag names are `1.1.0`, `1.0.2.0`, `1.0.1.0` etc. Please check the list of tags on Github. Be aware that if you install any tag from before I introduced support for Commandbox and Forgebox there won't be a `box.json` file and therefore Commandbox will give you a warning as well as there won't be any dependency management for such an installation of the library.
61-
62-
Shortcut for the above:
63-
64-
```
65-
box install MindscapeHQ/raygun4cfml#{tagname}
66-
```
53+
- Fork and clone the repository to your local system, or download a zip file of the current content or a specific release/tag.
6754

68-
To get the latest from my development repository (be warned, this might contain all sorts of untested code):
69-
70-
```
71-
box install TheRealAgentK/raygun4cfml
72-
```
55+
2. **Move Files:**
7356

74-
### Option 2:
57+
- Move the `src` and/or `tests` directories to locations suitable for your system.
7558

76-
Fork and clone the repo to your local system. Move the src/test directories into places of your choice and suitable for your system and follow the ideas outlined in 'Library organisation'.
59+
3. **Dependencies:**
7760

78-
### Option 3:
61+
- Note that manual installation will not automatically resolve dependencies.
7962

80-
Download a zip file containing the current content of the repo or a release/tag of your choice. Unzip the resulting file. Move the src/test directories into places of your choice and suitable for your system and follow the ideas outlined in 'Library organisation'.
63+
## Library Usage
8164

82-
#### Notes:
65+
### Initializing RaygunClient
8366

84-
(1) Options 2 and 3 will not fulfill any necessary dependencies, you're on your own.
67+
The `RaygunClient` is the primary component for sending error reports. You can initialize it in several ways depending on your setup:
8568

86-
## Version History
87-
88-
See CHANGELOG.md for further information.
89-
90-
## General Notes
69+
- **Webroot Setup:**
9170

92-
(1) All releases onwards from 0.5.0.0 will break your code if you've used 0.4 and older before and have used `customRequestData`.
71+
Place the contents of `/src` in your webroot and initialize the `RaygunClient` as follows:
72+
```cfml
73+
raygun = createObject("component", "com.raygun.RaygunClient").init(
74+
apiKey = "YOURAPIKEYHERE"
75+
);
76+
```
9377

94-
(2) If you are using the ACF Administrator setting: "Prefix serialized JSON with..." with anything else but the default prefix of `//`, the library will not work.
78+
- **Custom Mapping:**
9579

96-
(3) Version 1.1.0 and newer will not work on Adobe ColdFusion 8 and most likely not on Railo 3 (the latter not tested).
80+
Place the contents of `/src` in a directory of your choice and create a mapping to `/com` in your server administrator or through code. Them, initialise as suitable for the mapping.
9781

98-
(4) Version 1.7.0 and newer will most likely not work with Adobe ColdFUsion 2016 and Railo/Lucee 4.x.
9982

100-
(5) On newer Java versions (>11), there is no default access to Java Memory Management unless you add the following argument to your JVM configuration: `--add-opens java.management/sun.management=ALL-UNNAMED`
83+
### Using the Library
10184

102-
## How to contribute
85+
- **Error Reporting:**
10386

104-
Note: Please be aware that raygun4cfml is not an official Raygun library and not maintained by Raygun stuff. See [LICENSE](LICENSE) for more details.
87+
Once initialized, use the `RaygunClient` to send error reports with the `.send()` function. Refer to the `/samples` directory for examples.
10588

106-
The main repository of this project is https://github.com/MindscapeHQ/raygun4cfml. Please fork from there, create a local develop or feature branch and merge changes back to your local master branch to submit a pull request. Even better, get in touch with me on Twitter (@AgentK) or here on Github before you undertake any work so that it can be coordinated with what I'm doing.
107-
108-
Most of the active development happens in my own fork: https://github.com/TheRealAgentK/raygun4cfml - feel free to peek around in there.
89+
- **Testing:**
10990

91+
The `/tests` directory contains structures for Testbox unit and integration tests. Use these to validate your integration.
11092

93+
## Version History
11194

95+
For detailed version history, refer to the `CHANGELOG.md` file.
11296

97+
## Contribution Guidelines
11398

99+
Raygun4CFML is not an official Raygun library and is not maintained by Raygun staff.
114100

101+
Contributions are welcome.
115102

103+
Please fork the main repository at https://github.com/MindscapeHQ/raygun4cfml, create a feature branch, and submit a pull request. Coordination via X (@AgentK) or GitHub (https://github.com/TheRealAgentK/) is encouraged before starting any work.
116104

105+
For more active development, visit my development fork at https://github.com/TheRealAgentK/raygun4cfml.

box.json

Lines changed: 38 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name":"raygun4cfml",
3-
"version":"1.7.0",
4-
"location":"MindscapeHQ/raygun4cfml#1.7.0",
3+
"version":"2.0.0",
4+
"location":"MindscapeHQ/raygun4cfml#2.0.0",
55
"author":"Kai Koenig <kai@ventego-creative.co.nz>",
66
"homepage":"https://github.com/MindscapeHQ/raygun4cfml/",
77
"documentation":"https://github.com/MindscapeHQ/raygun4cfml/blob/master/README.md",
@@ -12,20 +12,48 @@
1212
"bugs":"https://github.com/MindscapeHQ/raygun4cfml/issues",
1313
"slug":"raygun4cfml",
1414
"shortDescription":"Provides integration with the Raygun CrashReporting API",
15-
"description":"API provider to send error information to Raygun crash reporting for tracking and analysis",
16-
"instructions":"Install this module and follow the guidelines in README.me as well as in /samples and /tests/test_manual",
17-
"changelog":"https://github.com/MindscapeHQ/raygun4cfml/blob/master/changelog.md",
18-
"keywords":["error","errortracking","bugs","bugtracking","raygun","raygun.io"],
15+
"description":"API provider to send error information to Raygun crash reporting for tracking and analysis.",
16+
"instructions":"Install this module and follow the guidelines in README.me as well as in /samples.",
17+
"changelog":"https://github.com/MindscapeHQ/raygun4cfml/blob/master/CHANGELOG.md",
18+
"keywords":[
19+
"error",
20+
"error tracking",
21+
"bugs",
22+
"bug tracking",
23+
"raygun",
24+
"crash reporting",
25+
"error reporting"
26+
],
1927
"engines":[
20-
{"type":"lucee","version":">=5.0.0"},
21-
{"type":"adobe","version":">=2018.0.0"}
28+
{
29+
"type":"lucee",
30+
"version":">=5.3.0"
31+
},
32+
{
33+
"type":"adobe",
34+
"version":">=2021.0.0"
35+
},
36+
{
37+
"type":"boxlang"
38+
}
2239
],
2340
"type":"logging",
2441
"projectURL":"https://github.com/MindscapeHQ/raygun4cfml/",
2542
"license":[
26-
{"type":"Apache 2.0","URL":"http://www.apache.org/licenses/LICENSE-2.0"}
43+
{
44+
"type":"Apache 2.0",
45+
"URL":"http://www.apache.org/licenses/LICENSE-2.0"
46+
}
2747
],
2848
"devDependencies":{
29-
"testbox":"x"
49+
"testbox":"6"
50+
},
51+
"scripts":{
52+
"format":"cfformat run src/**/*.cfc,tests/**/*.cfc,tests/**/*.cfm,samples/**/*.cfc,samples/**/*.cfm --overwrite",
53+
"format:watch":"cfformat watch src/**/*.cfc,tests/**/*.cfc,tests/**/*.cfm,samples/**/*.cfc,samples/**/*.cfm --overwrite",
54+
"format:check":"cfformat check src/**/*.cfc,tests/**/*.cfc,tests/**/*.cfm,samples/**/*.cfc,samples/**/*.cfm"
55+
},
56+
"installPaths":{
57+
"testbox":"testbox/"
3058
}
3159
}

samples/Application.cfc

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/**
2+
* Application.cfc - Main application configuration component
3+
* Handles core framework setup and request lifecycle management
4+
*/
5+
component {
6+
7+
// Map the /com directory to allow component resolution from the src folder
8+
// This enables cleaner imports without needing full file paths
9+
this.mappings = { "/com" : expandPath( "/src/com" ) };
10+
11+
/**
12+
* Runs at the start of each request
13+
* Sets up the Raygun error tracking API key for exception monitoring
14+
*/
15+
public void function onRequestStart() {
16+
variables.RAYGUNAPIKEY = "<YOUR API KEY>";
17+
}
18+
19+
}

0 commit comments

Comments
 (0)