```bash
#!/bin/bash

# Check if directory and days arguments are provided
if [ $# -ne 2 ]; then
    echo "Usage: $0 <directory> <days>"
    exit 1
fi

DIR="$1"
DAYS="$2"

# Validate that days is a positive integer
if ! [[ "$DAYS" =~ ^[0-9]+$ ]] || [ "$DAYS" -le 0 ]; then
    echo "Error: Days must be a positive integer."
    exit 1
fi

# Check if directory exists
if [ ! -d "$DIR" ]; then
    echo "Error: Directory '$DIR' does not exist."
    exit 1
fi

# Find files matching *.log older than N days and delete them
# Using -print0 and xargs -0 for safe handling of filenames with spaces/special chars
COUNT=$(find "$DIR" -type f -name "*.log" -mtime +"$DAYS" -print0 | tee >(xargs -0 rm -f) | tr -cd '\0' | wc -c)

echo "Removed $COUNT file(s)."
```