1.0.123 • Published 4 years ago

plink-functions v1.0.123

Weekly downloads
453
License
-
Repository
-
Last release
4 years ago

Plink Functions

Logging

Realm offers extremely minimal logging facilities, and so we have our own cloud logging system (Graylog 2) to allow us to keep more extensive, powerful logs. Ask Andrew how to access Graylog if you need to look at these logs.

pipeToRemote

This function from util is how logs messages are sent back to a remote host. If you have a need, you can redirect the logs to somewhere other than Graylog easily by changing the function passed to pipeToRemote.

Log Levels

emergency - 1
"HOLY SHIT IT'S ON FIRE!"

Something bad enough that, if an automated system to do this existed, an engineer should immediately be paged to come handle the error.

An emergency should be a big enough deal that it could result in a major breach, corrupted collections, system-wide failures, massive performance degradation racking up $10,000's+ in Realm/Atlas bills, etc.

An example would be detecting a bad value which indicates a programmer error which will disable the whole application, such as a bug that prevents anyone from logging in.

alert - 2
"First thing in the morning!"

An error which, if ignored until the morning, wouldn't be ruinous but could still cause serious consequences like lost business, a sullied image, a small breach, or very limited corruption of user data.

An example would be if users from a rather small locale (>1%) had a locale-specific bug which prevented them from using the application without corrupting anything.

error - 3
"Sometime before Friday..."

Usually if the input being processed by a function was invalid, and the whole request must be abandoned. Can also indicate what's very likely to be a programmer error.

An example would be the frontend generating requests which, in some edge cases, cannot be processed, or a permission which references a type of resource that doesn't exist.

Another good usage of an error would be detecting that a document is corrupted, such as if a required parent was not specified.

warning - 4
"I mean, we should fix it soon, but..."

Appropriate if this is the kind of thing you would want to stick out in the logs, such as a missing configuration value for which a (potentially suboptimal) default exists or if it's going to degrade performance or cause the user problems, a warning is fitting.

notice - 5
Just making the logs a little more useful

Something that isn't indicative of any programmer error but also isn't the "happy path".

An example would be that when a requester is not authorized to make a request.

This is the lowest logging level that is normally recorded.

info - 6 and debug - 7
Primarily for debugging and profiling

Information about what the function is doing that isn't "spammy".

The difference between info and debug is pretty subjective, so here's an example for permissions:

  • Recording the resources derived from a document change in derivePermissions is an info statement.
  • Logging the result of a single atomic permission comparison is a debug statement (because, for example, updating a Point might involve dozens of these).

info and debug logs will typically dump whole documents and large amounts of data, and so the default logging level is set to 5,

1.0.123

4 years ago

1.0.122

4 years ago

1.0.121

4 years ago

1.0.120

4 years ago

1.0.118

4 years ago

1.0.117

4 years ago

1.0.119

4 years ago

1.0.116

4 years ago

1.0.114

4 years ago

1.0.115

4 years ago

1.0.113

4 years ago

1.0.112

4 years ago

1.0.111

4 years ago

1.0.110

4 years ago

1.0.109

4 years ago

1.0.108

4 years ago

1.0.106

4 years ago

1.0.105

4 years ago

1.0.104

4 years ago

1.0.103

4 years ago

1.0.101

4 years ago

1.0.100

4 years ago

1.0.102

4 years ago

1.0.99

4 years ago

1.0.98

4 years ago

1.0.97

4 years ago

1.0.95

4 years ago

1.0.96

4 years ago

1.0.94

4 years ago

1.0.93

4 years ago

1.0.92

4 years ago

1.0.91

4 years ago

1.0.90

4 years ago

1.0.88

4 years ago

1.0.87

4 years ago

1.0.86

4 years ago

1.0.85

4 years ago

1.0.84

4 years ago

1.0.83

4 years ago

1.0.80

4 years ago

1.0.82

4 years ago

1.0.81

4 years ago

1.0.77

4 years ago

1.0.76

4 years ago

1.0.75

4 years ago

1.0.74

4 years ago

1.0.79

4 years ago

1.0.78

4 years ago

1.0.73

4 years ago

1.0.72

4 years ago

1.0.70

4 years ago

1.0.66

4 years ago

1.0.69

4 years ago

1.0.68

4 years ago

1.0.67

4 years ago

1.0.65

4 years ago

1.0.64

4 years ago

1.0.63

4 years ago

1.0.62

4 years ago

1.0.60

4 years ago

1.0.54

4 years ago

1.0.53

4 years ago

1.0.52

4 years ago

1.0.59

4 years ago

1.0.57

4 years ago

1.0.56

4 years ago

1.0.51

4 years ago

1.0.49

4 years ago

1.0.50

4 years ago

1.0.48

4 years ago

1.0.47

4 years ago

1.0.46

4 years ago

1.0.45

4 years ago

1.0.44

4 years ago

1.0.43

4 years ago

1.0.41

4 years ago

1.0.40

4 years ago

1.0.38

4 years ago

1.0.37

4 years ago

1.0.36

4 years ago

1.0.35

4 years ago

1.0.34

4 years ago

1.0.33

4 years ago

1.0.32

4 years ago

1.0.29

4 years ago

1.0.31

4 years ago

1.0.28

4 years ago

1.0.26

4 years ago

1.0.27

4 years ago

1.0.24

4 years ago

1.0.23

4 years ago

1.0.22

4 years ago

1.0.21

4 years ago

1.0.20

4 years ago

1.0.19

4 years ago

1.0.18

4 years ago

1.0.17

4 years ago

1.0.16

4 years ago

1.0.15

4 years ago

1.0.14

4 years ago

1.0.13

4 years ago

1.0.11

4 years ago

1.0.12

4 years ago

1.0.10

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.2

4 years ago

1.0.3

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago