You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In some cases you may want to store custom preferences in the `LOGGER_PREFS` table. A use case for this would be when creating a plugin that needs to reference some parameters.
773
778
774
-
This procedure allows you to leverage the `LOGGER_PREFS` table to store your custom preferences. To avoid any naming comflicts with Logger, all custom preferences must be prefixed with `CUST_`.
779
+
This procedure allows you to leverage the `LOGGER_PREFS` table to store your custom preferences. To avoid any naming conflicts with Logger, you must use a type (defined in `p_pref_type`). You can not use the type `LOGGER` as it is reserved for Logger system preferences.
775
780
776
-
`SET_CUST_PREF` will either create or udpate a value. Values must contain data. If not, use [`DEL_CUST_PREF`](#procedure-del_cust_pref) to delete unused preferences.
781
+
`SET_PREF` will either create or udpate a value. Values must contain data. If not, use [`DEL_PREF`](#procedure-del_pref) to delete unused preferences.
777
782
778
783
####Syntax
779
784
```sql
780
-
logger.set_cust_pref(
781
-
p_pref_name inlogger_prefs.pref_name%type,
782
-
p_pref_value inlogger_prefs.pref_value%type)
785
+
logger.set_pref(
786
+
p_pref_type inlogger_prefs.pref_type%type,
787
+
p_pref_name inlogger_prefs.pref_name%type,
788
+
p_pref_value inlogger_prefs.pref_value%type);
783
789
```
784
790
785
791
####Parameters
@@ -788,32 +794,38 @@ logger.set_cust_pref(
788
794
<th>Prameter</th>
789
795
<th>Description</th>
790
796
</tr>
797
+
<tr>
798
+
<td>p_pref_type</td>
799
+
<td>Type of preference. Use your own name space to avoid conflicts with Logger. Types will automatically be converted to uppercase</td>
800
+
</tr>
791
801
<tr>
792
802
<td>p_pref_name</td>
793
803
<td>Preference to get value for. Must be prefixed with "CUST_". Value will be created or updated. This value will be stored as uppercase.</td>
794
804
</tr>
795
-
<tr>
805
+
<tr>
796
806
<td>p_pref_value</td>
797
807
<td>Prefence value.</td>
798
808
</tr>
799
809
</table>
800
810
801
811
####Example
802
812
```sql
803
-
logger.set_cust_pref(
804
-
p_pref_name =>'CUST_MY_PREF',
813
+
logger.set_pref(
814
+
p_pref_type =>'CUSTOM'
815
+
p_pref_name =>'MY_PREF',
805
816
p_pref_value =>'some value');
806
817
```
807
818
808
819
809
-
<aname="procedure-del_cust_pref"></a>
810
-
###DEL_CUST_PREF
811
-
Deletes a custom preference.
820
+
<aname="procedure-del_pref"></a>
821
+
###DEL_PREF
822
+
Deletes a preference except for system level preferences.
Copy file name to clipboardExpand all lines: docs/Plugins.md
+16-12Lines changed: 16 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -30,16 +30,18 @@ There are two steps to configure a plugin. The first is to register a custom fun
30
30
```sql
31
31
update logger_prefs
32
32
set pref_value ='custom_plugin_method'
33
-
where pref_name ='PLUGIN_FN_ERROR'
33
+
where1=1
34
+
and pref_type =logger.g_pref_type_logger
35
+
and pref_name ='PLUGIN_FN_ERROR'
34
36
```
35
37
36
-
Once the custom method has been set in the ```logger_prefs table```, you must run the ```logger_configure``` procedure which will recompile Logger.
38
+
Once the custom method has been set in the `logger_prefs table`, you must run the `logger_configure` procedure which will recompile Logger.
37
39
38
40
```sql
39
41
exec logger_configure;
40
42
```
41
43
42
-
To deregister a plugin, set the appropriate ```logger_prefs.pref_value``` to ```null``` and re-run the ```logger_configure``` procedure. *Note: since ```pref_value``` is not a nullable column, null values will be automatically converted to "NONE".*
44
+
To deregister a plugin, set the appropriate `logger_prefs.pref_value` to `null` and re-run the `logger_configure` procedure. *Note: since `pref_value` is not a nullable column, null values will be automatically converted to "NONE".*
43
45
44
46
<aname="plugin-interface"></a>
45
47
#Plugin Interface
@@ -50,7 +52,7 @@ procedure <name_of_procedure>(
50
52
p_rec inlogger.rec_logger_log)
51
53
```
52
54
53
-
For more information about the ```logger.rec_logger_log``` type please see the [Types documentation](Logger%20API.md#types).
55
+
For more information about the `logger.rec_logger_log` type please see the [Types documentation](Logger%20API.md#types).
0 commit comments